From 7dbb64a2ea3df9fd4a4208ade016104042b69487 Mon Sep 17 00:00:00 2001 From: yugui Date: Wed, 17 Dec 2008 06:17:22 +0000 Subject: merges r20771 and r20772 from trunk into ruby_1_9_1. * ruby.c (set_arg0): use strlcpy() instead of strncpy(). * load.c (rb_feature_p): ditto. * dln.c (dln_load): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@20824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ruby.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'ruby.c') diff --git a/ruby.c b/ruby.c index 6a4a9afd0c..0d4a9903b5 100644 --- a/ruby.c +++ b/ruby.c @@ -1619,8 +1619,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); } -- cgit v1.2.3