iconv was not returning -1 on most failure
authorRich Felker <dalias@aerifal.cx>
Sun, 3 Jul 2011 23:26:12 +0000 (19:26 -0400)
committerRich Felker <dalias@aerifal.cx>
Sun, 3 Jul 2011 23:26:12 +0000 (19:26 -0400)
this broke most uses of iconv in real-world programs, especially
glib's iconv wrappers.

src/locale/iconv.c

index e1b00de..4ef1477 100644 (file)
@@ -559,9 +559,11 @@ ilseq:
        goto end;
 toobig:
        err = E2BIG;
+       x = -1;
        goto end;
 starved:
        err = EINVAL;
+       x = -1;
 end:
        errno = err;
        return x;