diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-03-20 17:01:30 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-03-20 17:01:30 +0000 |
commit | f83c5da39d1339f8d3ab00be0b214fc65cd69f44 (patch) | |
tree | 9ea99e238bb6bd42ebb923415696512ee85a4123 /sprintf.c | |
parent | 3c59330bfea992d86df30aed2181a75ad37aafeb (diff) | |
download | ruby-f83c5da39d1339f8d3ab00be0b214fc65cd69f44.tar.gz |
* sprintf.c (rb_f_sprintf): copy sign bits only if value is
negative.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3591 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sprintf.c')
-rw-r--r-- | sprintf.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -556,7 +556,12 @@ rb_f_sprintf(argc, argv) } } else { - char c = sign_bits(base, p); + char c; + + if (bignum && !RBIGNUM(val)->sign) + c = sign_bits(base, p); + else + c = '0'; while (len < prec--) { buf[blen++] = c; } |