cleanup types stuff in headers, fix missing u_int*_t in sys/types.h
[musl] / src / stdlib / wcstoumax.c
index a8f4680..86528ef 100644 (file)
@@ -1,4 +1,5 @@
 #include <wchar.h>
+#include <wctype.h>
 #include <stdlib.h>
 #include <inttypes.h>
 #include <errno.h>
@@ -33,7 +34,7 @@ uintmax_t wcstoumax(const wchar_t *s, wchar_t **p, int base)
 
        /* Convert to normal char string so we can use strtoumax */
        buf[0] = sign;
-       if (wcstombs(buf+!!sign, s, sizeof buf-1) < 0) return 0;
+       if (wcstombs(buf+!!sign, s, sizeof buf-1) == -1) return 0;
        buf[sizeof buf-1]=0;
 
        /* Compute final position */