scc

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

commit e5149360ecf4c42b45c0992ae7a31e8c20a75869
parent 5c18e618e075ee090ca30a507da86c87d7fd4295
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Fri,  4 Nov 2022 06:06:20 +0100

libc/stdlib: Fix operator precedence in mbtowc()

Diffstat:
Msrc/libc/stdlib/mbtowc.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libc/stdlib/mbtowc.c b/src/libc/stdlib/mbtowc.c @@ -22,7 +22,7 @@ mbtowc(wchar_t *restrict pwc, const char *restrict s, size_t n) goto return_code; for (wc = (c & 0xFF) >> len; len--; wc |= c & 0x3F) { - if ((c = *t++) & 0xC0 != 0x80) + if (((c = *t++) & 0xC0) != 0x80) return -1; wc <<= 6; }