diff options
| author | Jakob Kaivo <jkk@ung.org> | 2019-02-28 20:27:20 -0500 |
|---|---|---|
| committer | Jakob Kaivo <jkk@ung.org> | 2019-02-28 20:27:20 -0500 |
| commit | aeb470def92ecf2af567ffb027097c99a6cb2d2b (patch) | |
| tree | 11c1e2ed322f2edbb210c68879cf320d526de684 /src | |
| parent | e1f2f0b11930f8f36d94020b59a23c4d5664b3ea (diff) | |
fix outputing 0
Diffstat (limited to 'src')
| -rw-r--r-- | src/nonstd/_printf.h | 4 |
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]; |
