summaryrefslogtreecommitdiff
path: root/src/nonstd
diff options
context:
space:
mode:
Diffstat (limited to 'src/nonstd')
-rw-r--r--src/nonstd/_printf.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nonstd/_printf.h b/src/nonstd/_printf.h
index 95a4c94c..31b2d82e 100644
--- a/src/nonstd/_printf.h
+++ b/src/nonstd/_printf.h
@@ -38,6 +38,10 @@ static void __itos(char *s, intmax_t n, int flags, int precision, int base)
}
*out = '\0';
out--;
+ if (n == 0) {
+ *out = '0';
+ out--;
+ }
while (n > 0) {
precision--;
*out = digits[n % base];