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:
Yukihiro "Matz" Matsumoto
2024-07-30 11:33:18 +09:00
parent ab95e042ca
commit 3c5baac5c5
+3
View File
@@ -666,6 +666,9 @@ retry:
}
if (dots) {
if (base == 8 && (*s == '1' || *s == '3')) {
s++; len--;
}
while (*s == fc) {
s++; len--;
}