scc

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

commit 6ed5716792875bb18530a739fb407ba688b01347
parent da31e976ff59d68d4c5758761e6862c002a283c2
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Mon,  7 Nov 2022 10:29:19 +0100

libc/stdio: Enable printing wide strings

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 @@ -348,7 +348,8 @@ flags: case 's': if (flags & LONG) { ws = va_arg(va2, wchar_t *); - /* len = wcsnlen(ws, conv.prec); */ + if ((len = wcslen(ws)) > conv.prec) + len = conv.prec; goto wstrout; } else { s = va_arg(va2, char *);