summaryrefslogtreecommitdiffstats
path: root/ruby.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-16 02:37:45 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-16 02:37:45 +0000
commit3deb2793cac0b6f9f8483994bdc6cf5f6ea5c394 (patch)
tree9f770332e0e729915f28175c1d53be2136e31032 /ruby.c
parent622e0fcc9a05b67f2d3e150f1bb92993c482e587 (diff)
downloadruby-3deb2793cac0b6f9f8483994bdc6cf5f6ea5c394.tar.gz
ruby-3deb2793cac0b6f9f8483994bdc6cf5f6ea5c394.tar.xz
ruby-3deb2793cac0b6f9f8483994bdc6cf5f6ea5c394.zip
* ruby.c (set_arg0): use strlcpy() instead of strncpy().
* load.c (rb_feature_p): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/ruby.c b/ruby.c
index 24f1b706c..ee21195b9 100644
--- a/ruby.c
+++ b/ruby.c
@@ -1648,8 +1648,7 @@ set_arg0(VALUE val, ID id)
if (i > PST_CLEN) {
union pstun un;
char buf[PST_CLEN + 1]; /* PST_CLEN is 64 (HP-UX 11.23) */
- strncpy(buf, s, PST_CLEN);
- buf[PST_CLEN] = '\0';
+ strlcpy(buf, s, sizeof(buf));
un.pst_command = buf;
pstat(PSTAT_SETCMD, un, PST_CLEN, 0, 0);
}