about summary refs log tree commit diff
path: root/src/stdlib/wcstoimax.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stdlib/wcstoimax.c')
-rw-r--r--src/stdlib/wcstoimax.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/stdlib/wcstoimax.c b/src/stdlib/wcstoimax.c
index b83206b7..50647f62 100644
--- a/src/stdlib/wcstoimax.c
+++ b/src/stdlib/wcstoimax.c
@@ -7,7 +7,6 @@
 intmax_t wcstoimax(const wchar_t *s, wchar_t **p, int base)
 {
 	struct intparse ip = {0};
-	unsigned char tmp;
 
 	if (p) *p = (wchar_t *)s;
 
@@ -19,7 +18,7 @@ intmax_t wcstoimax(const wchar_t *s, wchar_t **p, int base)
 	for (; iswspace(*s); s++);
 
 	ip.base = base;
-	for (; *s<256 && (tmp=*s, __intparse(&ip, &tmp, 1)); s++);
+	for (; __intparse(&ip, (char[]){(*s&-(*s<128U))}, 1); s++);
 
 	if (p && ip.err != EINVAL)
 		*p = (wchar_t *)s;