scc

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

commit 4e49446b128eea514d692e1b071ce84c926127e5
parent 97caea2d7a7e55453218c4457a18f4c692b2ac52
Author: Quentin Rameau <quinq@fifth.space>
Date:   Fri,  8 May 2020 19:54:58 +0200

libc: remove non-C99 strnlen usage in vfprintf

Diffstat:
Msrc/libc/stdio/vfprintf.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/libc/stdio/vfprintf.c b/src/libc/stdio/vfprintf.c @@ -350,7 +350,8 @@ flags: goto wstrout; } else { s = va_arg(va2, char *); - len = strnlen(s, conv.prec); + if ((len = strlen(s)) > conv.prec) + len = conv.prec; goto strout; } wstrout: