summaryrefslogtreecommitdiff
path: root/sprintf.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-02-10 08:44:05 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-02-10 08:44:05 +0000
commit3ab072c0dc748031816ebfbdccdc10fa4212a9db (patch)
tree1af982c2e02748e9f72146220e9f62d6c5728ff0 /sprintf.c
parentb2fa1cbeda1b7893910205f38733430f521c3744 (diff)
1.1b7 pre3
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@69 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sprintf.c')
-rw-r--r--sprintf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sprintf.c b/sprintf.c
index 07f8a42..57ce682 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -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 {