summaryrefslogtreecommitdiff
path: root/sprintf.c
diff options
context:
space:
mode:
Diffstat (limited to 'sprintf.c')
-rw-r--r--sprintf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sprintf.c b/sprintf.c
index 7862a469e8..57ce682b5e 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -6,7 +6,7 @@
$Date$
created at: Fri Oct 15 10:39:26 JST 1993
- Copyright (C) 1993-1996 Yukihiro Matsumoto
+ Copyright (C) 1993-1998 Yukihiro Matsumoto
************************************************/
@@ -327,7 +327,7 @@ f_sprintf(argc, argv)
bignum = 1;
break;
case T_STRING:
- val = str2inum(RSTRING(val)->ptr, 0);
+ val = str2inum(RSTRING(val)->ptr, 10);
goto bin_retry;
case T_BIGNUM:
bignum = 1;
@@ -339,10 +339,10 @@ f_sprintf(argc, argv)
if (*p == 'x') base = 16;
else if (*p == 'o') base = 8;
- else if (*p == 'u') base = 10;
+ else if (*p == 'u' || *p == 'd') base = 10;
else if (*p == 'b' || *p == 'B') base = 2;
if (!bignum) {
- if (*p == 'b' || *p == 'B') {
+ if (base == 2) {
val = int2big(v);
}
else {