summaryrefslogtreecommitdiff
path: root/sprintf.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-17 01:29:17 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-17 01:29:17 +0000
commit22cde7b682328ba195ce0ee214edb6c2feb81b23 (patch)
tree7873fbf3dad59cb2042390c1c2dbfe90d5b6e647 /sprintf.c
parentea9628c3bc700c5162a6298b79d2b8cd7a334fea (diff)
* dir.c, dln.c, parse.y, re.c, ruby.c, sprintf.c, strftime.c,
string.c, util.c, variable.c: use strlcpy, memcpy and snprintf instead of strcpy, strncpy and sprintf. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sprintf.c')
-rw-r--r--sprintf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sprintf.c b/sprintf.c
index 772f232..58dedd3 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -988,7 +988,7 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
buf[blen++] = '+';
else if (flags & FSPACE)
blen++;
- strncpy(&buf[blen], expr, strlen(expr));
+ memcpy(&buf[blen], expr, strlen(expr));
}
else {
if (!isnan(fval) && fval < 0.0)
@@ -997,8 +997,8 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
buf[blen + need - strlen(expr) - 1] = '+';
else if ((flags & FSPACE) && need > width)
blen++;
- strncpy(&buf[blen + need - strlen(expr)], expr,
- strlen(expr));
+ memcpy(&buf[blen + need - strlen(expr)], expr,
+ strlen(expr));
}
blen += strlen(&buf[blen]);
break;