summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-sprintf/src/sprintf.c
diff options
context:
space:
mode:
Diffstat (limited to 'mrbgems/mruby-sprintf/src/sprintf.c')
-rw-r--r--mrbgems/mruby-sprintf/src/sprintf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mrbgems/mruby-sprintf/src/sprintf.c b/mrbgems/mruby-sprintf/src/sprintf.c
index d4290ec59..b5f9284d9 100644
--- a/mrbgems/mruby-sprintf/src/sprintf.c
+++ b/mrbgems/mruby-sprintf/src/sprintf.c
@@ -720,10 +720,10 @@ retry:
CHECK(n);
memcpy(buf+blen, c, n);
blen += n;
- FILL(' ', width-1);
+ if (width>0) FILL(' ', width-1);
}
else {
- FILL(' ', width-1);
+ if (width>0) FILL(' ', width-1);
CHECK(n);
memcpy(buf+blen, c, n);
blen += n;