Browse Source

iconv was not returning -1 on most failure

this broke most uses of iconv in real-world programs, especially
glib's iconv wrappers.
Rich Felker 14 years ago
parent
commit
2f0c415ceb
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/locale/iconv.c

+ 2 - 0
src/locale/iconv.c

@@ -559,9 +559,11 @@ ilseq:
 	goto end;
 	goto end;
 toobig:
 toobig:
 	err = E2BIG;
 	err = E2BIG;
+	x = -1;
 	goto end;
 	goto end;
 starved:
 starved:
 	err = EINVAL;
 	err = EINVAL;
+	x = -1;
 end:
 end:
 	errno = err;
 	errno = err;
 	return x;
 	return x;