summaryrefslogtreecommitdiff
path: root/sprintf.c
diff options
context:
space:
mode:
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 caea4c587f..b89f441708 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) {