diff options
author | (no author) <(no author)@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-02-10 08:44:05 +0000 |
---|---|---|
committer | (no author) <(no author)@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-02-10 08:44:05 +0000 |
commit | 36f3603cae6536e571220721e916b8d284cf0675 (patch) | |
tree | eb9605811483000f6980263aa163b4f627ab1c3f /sprintf.c | |
parent | fd1d8cdc09ed86e4a0812120a17ff0d7b04adcaf (diff) |
This commit was manufactured by cvs2svn to create tag 'v1_1b7'.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_1b7@70 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sprintf.c')
-rw-r--r-- | sprintf.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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 { |