aboutsummaryrefslogtreecommitdiffstats
path: root/sprintf.c
diff options
context:
space:
mode:
Diffstat (limited to 'sprintf.c')
-rw-r--r--sprintf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sprintf.c b/sprintf.c
index e8c0d36164..580a54ae8f 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -604,11 +604,12 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
}
}
else {
+ volatile VALUE tmp1;
if (!RBIGNUM(val)->sign) {
val = rb_big_clone(val);
rb_big_2comp(val);
}
- tmp = rb_big2str(val, base);
+ tmp1 = tmp = rb_big2str(val, base);
s = RSTRING(tmp)->ptr;
if (*s == '-') {
if (base == 10) {