summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-sprintf/src/sprintf.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2015-11-19 03:16:05 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2015-11-19 22:49:50 +0900
commitf974880563e75be84631276875e88c79ff03a970 (patch)
tree02d9f2427df13c26468be7907916442bfbc259b2 /mrbgems/mruby-sprintf/src/sprintf.c
parent996417cabfd4f9422ab00530874837e2cf6a2cf6 (diff)
downloadmruby-f974880563e75be84631276875e88c79ff03a970.tar.gz
mruby-f974880563e75be84631276875e88c79ff03a970.zip
binary format no longer need to preserve org_v
Diffstat (limited to 'mrbgems/mruby-sprintf/src/sprintf.c')
-rw-r--r--mrbgems/mruby-sprintf/src/sprintf.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/mrbgems/mruby-sprintf/src/sprintf.c b/mrbgems/mruby-sprintf/src/sprintf.c
index af3cfd5cb..43c5d9827 100644
--- a/mrbgems/mruby-sprintf/src/sprintf.c
+++ b/mrbgems/mruby-sprintf/src/sprintf.c
@@ -763,7 +763,7 @@ retry:
const char *prefix = NULL;
int sign = 0, dots = 0;
char sc = 0;
- mrb_int v = 0, org_v = 0;
+ mrb_int v = 0;
int base;
mrb_int len;
@@ -827,7 +827,6 @@ retry:
}
if (base == 2) {
- org_v = v;
if (v < 0 && !sign) {
val = mrb_fix2binstr(mrb, mrb_fixnum_value(v), base);
dots = 1;
@@ -964,7 +963,7 @@ retry:
CHECK(prec - len);
if (dots) PUSH("..", 2);
- if (v < 0 || (base == 2 && org_v < 0)) {
+ if (v < 0) {
char c = sign_bits(base, p);
while (len < prec--) {
buf[blen++] = c;