From 2adbd223b794ec8dbfb90def60cc2a13cb8dfe42 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Fri, 25 Jul 2025 02:53:15 -0400 Subject: usr: libc: Escape '%' with '%%' in vsnprintf() Signed-off-by: Ian Moffett --- lib/libc/src/stdio/vsnprintf.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/libc/src/stdio/vsnprintf.c') diff --git a/lib/libc/src/stdio/vsnprintf.c b/lib/libc/src/stdio/vsnprintf.c index 24b2df6..0e3d268 100644 --- a/lib/libc/src/stdio/vsnprintf.c +++ b/lib/libc/src/stdio/vsnprintf.c @@ -84,6 +84,9 @@ vsnprintf(char *s, size_t size, const char *fmt, va_list ap) c = *fmt++; switch (c) { + case '%': + printc(s, size, &off, c); + break; case 'c': c1 = (char )__va_arg(ap, int); printc(s, size, &off, c1); -- cgit v1.2.3