projects
/
eightysix
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5bb5ac3
)
printf: fixed handling of 0 values in conversions
author
John Tsiombikas
<nuclear@member.fsf.org>
Sat, 17 Aug 2024 02:31:05 +0000
(
05:31
+0300)
committer
John Tsiombikas
<nuclear@member.fsf.org>
Sat, 17 Aug 2024 02:31:05 +0000
(
05:31
+0300)
kern/src/libc/stdio.c
patch
|
blob
|
history
diff --git
a/kern/src/libc/stdio.c
b/kern/src/libc/stdio.c
index
f2a9619
..
f34c1f7
100644
(file)
--- a/
kern/src/libc/stdio.c
+++ b/
kern/src/libc/stdio.c
@@
-165,7
+165,7
@@
static int wrint(struct outbuf *outbuf, struct format *fmt, long val)
}
if(val == 0) {
- *ptr++ = '0';
+ *--ptr = '0';
}
switch(fmt->base) {
@@
-208,7
+208,7
@@
static int wruint(struct outbuf *outbuf, struct format *fmt, unsigned long val)
buf[15] = 0;
if(val == 0) {
- *ptr++ = '0';
+ *--ptr = '0';
}
switch(fmt->base) {