summaryrefslogtreecommitdiff
path: root/sprintf.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-01-10 09:52:13 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-01-10 09:52:13 +0000
commit4c09e12b04cfcc580b70a20c501d2c1cb6b5c799 (patch)
tree3b8b4a18c1369d6d0e6a9f27dfeaca676d7ac54b /sprintf.c
parentfd8eadd2af0665aa1db50a554631d5ca568e9d50 (diff)
m17n cleanup ;_;
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sprintf.c')
-rw-r--r--sprintf.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/sprintf.c b/sprintf.c
index cb567315ba..05befb00c1 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -185,7 +185,6 @@ rb_f_sprintf(argc, argv)
int n;
for (t = p; t < end && *t != '%'; t++) ;
- CHECK(t - p);
PUSH(p, t - p);
if (t >= end) {
/* end of fmt string */
@@ -342,9 +341,7 @@ rb_f_sprintf(argc, argv)
break;
}
}
- CHECK(len);
- memcpy(&buf[blen], RSTRING(str)->ptr, len);
- blen += len;
+ PUSH(RSTRING(str)->ptr, len);
}
break;
@@ -529,9 +526,7 @@ rb_f_sprintf(argc, argv)
if (sc) PUSH(&sc, 1);
if (prefix) {
int plen = strlen(prefix);
- CHECK(plen);
- strcpy(&buf[blen], prefix);
- blen += plen;
+ PUSH(prefix, plen);
if (pos) pos += plen;
}
if (!(flags & FMINUS)) {
@@ -556,9 +551,7 @@ rb_f_sprintf(argc, argv)
while (len < prec--) {
buf[blen++] = s[0]=='.'?'.':'0';
}
- CHECK(len);
- strcpy(&buf[blen], s);
- blen += len;
+ PUSH(s, len);
CHECK(width);
while (width-->0) {
buf[blen++] = ' ';