diff options
author | Ian Moffett <ian@osmora.org> | 2025-07-25 02:53:15 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-07-25 02:54:17 -0400 |
commit | 2adbd223b794ec8dbfb90def60cc2a13cb8dfe42 (patch) | |
tree | 5b67613bfb4142c0b427304132231c89baf8e798 /lib/libc/src/stdio/vsnprintf.c | |
parent | 48587c836af7a008eff4964094e97aa1c94a34b0 (diff) |
usr: libc: Escape '%' with '%%' in vsnprintf()
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'lib/libc/src/stdio/vsnprintf.c')
-rw-r--r-- | lib/libc/src/stdio/vsnprintf.c | 3 |
1 files changed, 3 insertions, 0 deletions
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); |