diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-01-10 09:52:13 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-01-10 09:52:13 +0000 |
commit | 4c09e12b04cfcc580b70a20c501d2c1cb6b5c799 (patch) | |
tree | 3b8b4a18c1369d6d0e6a9f27dfeaca676d7ac54b /sprintf.c | |
parent | fd8eadd2af0665aa1db50a554631d5ca568e9d50 (diff) | |
download | ruby-4c09e12b04cfcc580b70a20c501d2c1cb6b5c799.tar.gz |
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.c | 13 |
1 files changed, 3 insertions, 10 deletions
@@ -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++] = ' '; |