From 41294ec0a4b319e2143f2f6b2d9d899d42d415c2 Mon Sep 17 00:00:00 2001 From: Lephe Date: Sun, 14 Jun 2020 08:15:00 +0200 Subject: [PATCH] printf: fix %% doubling down as a format specifier When parsing a %% format, the second % character was mistakenly not skipped over after emitting a '%' output; this resulted in it being treated as a format specifier. For instance, printf("%%d", 12); would print "%12". --- src/std/stdio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/std/stdio.c b/src/std/stdio.c index 9a670da..bdfdb7e 100644 --- a/src/std/stdio.c +++ b/src/std/stdio.c @@ -227,6 +227,7 @@ void kprint(char const *format, va_list *args) if(c == '%') { kprint_out('%'); + format++; continue; }