summaryrefslogtreecommitdiff
path: root/sprintf.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-07-03 07:06:51 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-07-03 07:06:51 +0000
commitab801dbdb7ff8a99b5e0976516b879b27bcf3e1b (patch)
tree2657a1ca78c166beda5dfb609f9c53c5bae6f85c /sprintf.c
parent1a2003d1f176001f4c691d14a080e722bb12fc7b (diff)
1.1b9_29
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sprintf.c')
-rw-r--r--sprintf.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sprintf.c b/sprintf.c
index dac3659..5bc5303 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -311,13 +311,14 @@ f_sprintf(argc, argv)
{
volatile VALUE val = GETARG();
char fbuf[32], nbuf[64], *s, *t;
- int v, base, bignum = 0;
+ long v;
+ int base, bignum = 0;
int len, slen, pos;
bin_retry:
switch (TYPE(val)) {
case T_FIXNUM:
- v = FIX2INT(val);
+ v = FIX2LONG(val);
break;
case T_FLOAT:
val = dbl2big(RFLOAT(val)->value);
@@ -471,7 +472,7 @@ f_sprintf(argc, argv)
int_retry:
switch (TYPE(val)) {
case T_FIXNUM:
- v = FIX2INT(val);
+ v = FIX2LONG(val);
break;
case T_FLOAT:
v = RFLOAT(val)->value;
@@ -567,7 +568,7 @@ f_sprintf(argc, argv)
switch (TYPE(val)) {
case T_FIXNUM:
- fval = FIX2INT(val);
+ fval = (double)FIX2LONG(val);
break;
case T_FLOAT:
fval = RFLOAT(val)->value;