scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit 024290594a65d206f461b06b91c68cace9e01dc7
parent 280508b30664c2113e2eb64cf39cdf09ac1426fe
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Thu, 27 Oct 2022 15:59:40 +0200

libc: Set value of val in vfprintf()

Val is used after the if-else-if but in the case of size_t
it was not initialized to any value.

Diffstat:
Msrc/libc/stdio/vfprintf.c | 1+
1 file changed, 1 insertion(+), 0 deletions(-)

diff --git a/src/libc/stdio/vfprintf.c b/src/libc/stdio/vfprintf.c @@ -49,6 +49,7 @@ getnum(va_list *va, int flags, int *sign) val = va_arg(*va, long long); uval = (unsigned long long) val; } else if (flags & SIZET) { + val = 0; uval = va_arg(*va, size_t); } else if (flags & INTMAX) { val = va_arg(*va, intmax_t);