From d42cd7b090ce55ef0fae8b16c177893a433718ce Mon Sep 17 00:00:00 2001 From: Michael Shaw Date: Mon, 23 Oct 2023 21:54:14 -0400 Subject: [PATCH] stdio: fix some page faults --- lib/stdio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/stdio.c b/lib/stdio.c index 679b092..931fda5 100644 --- a/lib/stdio.c +++ b/lib/stdio.c @@ -74,10 +74,11 @@ int vsnprintf(char *str, const char *restrict fmt, size_t size, va_list args) case 'c': i = va_arg(args, int); ret++; - str[ret] = i; + str[ret] = i & 0xFF; break; case 'x': i = va_arg(args, int); + n = 0; memset(buf, 0, sizeof(buf));