projects
/
onyx.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
78637ad
)
Bugfix for negatives in bh_printf
author
Brendan Hansen
<brendan.f.hansen@gmail.com>
Thu, 21 May 2020 04:09:29 +0000
(23:09 -0500)
committer
Brendan Hansen
<brendan.f.hansen@gmail.com>
Thu, 21 May 2020 04:09:29 +0000
(23:09 -0500)
bh.h
patch
|
blob
|
history
diff --git
a/bh.h
b/bh.h
index 26ff3bc0f9580e29dbce1a8cc61bfead7d8fb3e4..282608ae4674c64872014addb95f73247525b145 100644
(file)
--- 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 {