Преглед на файлове

fix broken unsigned comparison in wcstoumax

Rich Felker преди 14 години
родител
ревизия
4095f8338d
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      src/stdlib/wcstoumax.c

+ 1 - 1
src/stdlib/wcstoumax.c

@@ -34,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 */