mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
mruby-sprintf: fix a bug with negative octals
Leading octal digit may be 1, 3, 7 unlike binary or hexadecimal.
This commit is contained in:
@@ -666,6 +666,9 @@ retry:
|
||||
}
|
||||
|
||||
if (dots) {
|
||||
if (base == 8 && (*s == '1' || *s == '3')) {
|
||||
s++; len--;
|
||||
}
|
||||
while (*s == fc) {
|
||||
s++; len--;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user