diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-07-05 17:48:40 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-07-05 17:48:40 +0900 |
| commit | b643a1a8bc89b7898d05dc2e26d87f708a5edc32 (patch) | |
| tree | e0bc54c35bcc3e94bc8574f9cb6525586675d75e /mrbgems/mruby-sprintf | |
| parent | bd66c5d716eed470957a90bd2851292165550ee1 (diff) | |
| download | mruby-b643a1a8bc89b7898d05dc2e26d87f708a5edc32.tar.gz mruby-b643a1a8bc89b7898d05dc2e26d87f708a5edc32.zip | |
In Ruby, `sprintf` specifier `%u` should behave as `%d`; fix #3730
Since there's no unsigned integer in Ruby. Binary, octal and
hexadecimal negative numbers can be represented by using 2's
compliment. But decimal (not being power of 2) cannot be use
that kind of format.
Diffstat (limited to 'mrbgems/mruby-sprintf')
| -rw-r--r-- | mrbgems/mruby-sprintf/src/sprintf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mrbgems/mruby-sprintf/src/sprintf.c b/mrbgems/mruby-sprintf/src/sprintf.c index df0edf590..d62a28e8c 100644 --- a/mrbgems/mruby-sprintf/src/sprintf.c +++ b/mrbgems/mruby-sprintf/src/sprintf.c @@ -838,10 +838,10 @@ retry: case 'b': case 'B': base = 2; break; + case 'u': case 'd': case 'i': sign = 1; - case 'u': default: base = 10; break; } |
