From d0a87b06a9ff0ee4adf04b1ce29387223005f7af Mon Sep 17 00:00:00 2001 From: Zack Buhman Date: Wed, 21 May 2025 04:03:53 -0500 Subject: [PATCH] printf: fix pad parsing --- c/printf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/c/printf.c b/c/printf.c index d733991..5535f18 100644 --- a/c/printf.c +++ b/c/printf.c @@ -29,7 +29,7 @@ static const char * parse_fill_pad(const char * format, struct format * ft) { if (*format == 0) return format; - if (*format >= '1' || *format <= '9') + if (*format >= '1' && *format <= '9') ft->fill_char = ' '; else ft->fill_char = *format++; @@ -143,7 +143,7 @@ void _printf(const char * format, ...) print_char('0'); print_char('x'); } - /* fall through */; + /* fall through */ case FORMAT_BASE16: { uint32_t num = va_arg(args, uint32_t);