* charsets.c (translate_character): Fixed checking of the return

value of iconv().
This commit is contained in:
Roland Illig 2005-05-11 21:50:36 +00:00
parent 77aa6b59ce
commit 10c2c57663
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2005-05-11 Roland Illig <roland.illig@gmx.de>
* charsets.c (translate_character): Fixed checking of the return
value of iconv().
2005-05-10 Pavel Roskin <proski@gnu.org>
* .c: Sanitize all calls to functions from ctype.h. Fix gcc 4.0

View File

@ -153,7 +153,7 @@ translate_character (iconv_t cd, char c)
obuflen = 4;
count = iconv (cd, &ibuf, &ibuflen, &obuf, &obuflen);
if (count >= 0 && ibuflen == 0)
if (count != ((size_t) -1) && ibuflen == 0)
return outbuf[0];
return UNKNCHAR;