Fix checking of iconv_open return code.

Based on libiconv documentation, the iconv_open function returns
(iconv_t)(-1).

Signed-off-by: Tomas Hozza <thozza@redhat.com>
This commit is contained in:
Tomas Hozza 2014-07-07 22:15:59 +02:00 committed by Giuseppe Scrivano
parent c5f2c7fcef
commit e43ae39dff
2 changed files with 5 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2014-07-07 Tomas Hozza <thozza@redhat.com>
* iri.c (locale_to_utf8): Fix checking of iconv_open return code.
2014-07-05 Darshit Shah <darnir@gmail.com>
* cookies.c (check_domain_match): Libpsl requires that all domain names

View File

@ -129,7 +129,7 @@ locale_to_utf8 (const char *str)
return str;
l2u = iconv_open ("UTF-8", opt.locale);
if (l2u != (iconv_t)(-1))
if (l2u == (iconv_t)(-1))
{
logprintf (LOG_VERBOSE, _("Conversion from %s to %s isn't supported\n"),
quote (opt.locale), quote ("UTF-8"));