From: Brendan Hansen Date: Thu, 21 May 2020 04:09:29 +0000 (-0500) Subject: Bugfix for negatives in bh_printf X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=dba1db27ab36b4c0e3a7111c2f0fc61dfab8fa5a;p=onyx.git Bugfix for negatives in bh_printf --- diff --git a/bh.h b/bh.h index 26ff3bc0..282608ae 100644 --- a/bh.h +++ b/bh.h @@ -1337,9 +1337,11 @@ isize bh__printi64(char* str, isize n, bh__print_format format, i64 value) { char buf[128]; buf[127] = 0; char* walker = buf + 127; - b32 negative = value < 0; u32 base = format.base ? format.base : 10, tmp; + b32 negative = value < 0; + if (negative) value = -value; + if (value == 0) { *--walker = '0'; } else {