From 573e4c150b7d588b8b99c7cfc35bfbb67d41932d Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Sun, 24 Oct 2021 03:02:02 +0200 Subject: Fix vprintf(3) TODO: what did this actually fix? --- libpsx/src/libc/printf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libpsx/src') diff --git a/libpsx/src/libc/printf.c b/libpsx/src/libc/printf.c index d2deeb0..b332313 100644 --- a/libpsx/src/libc/printf.c +++ b/libpsx/src/libc/printf.c @@ -811,9 +811,9 @@ static int __vsnprintf_internal(char *string, size_t size, const char *fmt, va_l static int vsnprintf_put_in_string(char *string, unsigned int sz, char c, int pos) { - if(pos>=sz) + if(pos >= sz && c) return 0; - else + else if (c || pos <= sz) string[pos] = c; return 1; -- cgit v1.2.3