summaryrefslogtreecommitdiff
path: root/sprintf.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-04-08 09:02:04 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-04-08 09:02:04 +0000
commitf92f8b565f2e749c58f0998fdcf6f23d52096fe3 (patch)
tree23930e9fcf0451f76eaf9458eea8070fcff8ee38 /sprintf.c
parent5c9d3fac30ada76110bd0fcd31402e4bd979bb36 (diff)
* random.c (rb_f_rand): normalize bignum argument.
* sprintf.c (rb_f_sprintf): was decrementing width even if there is no sign character. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sprintf.c')
-rw-r--r--sprintf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sprintf.c b/sprintf.c
index caea4c5..b89f441 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -475,14 +475,16 @@ rb_f_sprintf(argc, argv)
if (s[0] == '-') {
s++;
sc = '-';
+ width--;
}
else if (flags & FPLUS) {
sc = '+';
+ width--;
}
else if (flags & FSPACE) {
sc = ' ';
+ width--;
}
- width--;
goto format_integer;
}
if (!RBIGNUM(val)->sign) {