summaryrefslogtreecommitdiffstats
path: root/sprintf.c
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-22 00:50:32 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-22 00:50:32 +0000
commit93a0db20b61344b45f676cf8bfe9aa3c89e04d49 (patch)
tree9695048ca75d0e05b42f4ccb4dac5d0822a0af12 /sprintf.c
parent9baa9e93101d8c43a486f1ca2f8aefaec29a7c67 (diff)
downloadruby-93a0db20b61344b45f676cf8bfe9aa3c89e04d49.tar.gz
ruby-93a0db20b61344b45f676cf8bfe9aa3c89e04d49.tar.xz
ruby-93a0db20b61344b45f676cf8bfe9aa3c89e04d49.zip
* sprintf.c (rb_f_sprintf): sign bit extension should not be done
if FPLUS flag is specified. [ruby-list:39224] numbers if FZERO is specified. [ruby-list:39218] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8_6@13158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sprintf.c')
-rw-r--r--sprintf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sprintf.c b/sprintf.c
index ffe4e2285..e3b0310dd 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -677,7 +677,7 @@ rb_f_sprintf(argc, argv)
else {
char c;
- if (bignum && !RBIGNUM(val)->sign)
+ if (!sign && bignum && !RBIGNUM(val)->sign)
c = sign_bits(base, p);
else
c = '0';