diff options
author | Jakob Kaivo <jkk@ung.org> | 2020-08-17 15:39:58 -0400 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2020-08-17 15:39:58 -0400 |
commit | 55fc64c7ffd7792bc88451a736c2e94e5865282f (patch) | |
tree | a78b4255c76bb1e292c17c86a50816473dfd6006 /src/stdio | |
parent | f48efbd44aeb1f0c71666e1b7866ab4a83a98acf (diff) |
fix overflow that messes up numbers with 0 in them
Diffstat (limited to 'src/stdio')
-rw-r--r-- | src/stdio/__printf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stdio/__printf.c b/src/stdio/__printf.c index ad266e2c..0429d5bf 100644 --- a/src/stdio/__printf.c +++ b/src/stdio/__printf.c @@ -51,7 +51,7 @@ static void __itos(char *s, intmax_t n, int flags, int precision, int base) extern int toupper(int); char digits[] = "0123456789abcdef"; char sign = n < 0 ? '-' : '+'; - char buf[NUMBUFLEN]; + char buf[NUMBUFLEN + 1]; char *out = buf + NUMBUFLEN; if (flags & UPPER && base > 10) { size_t i; |