From e43ae39dff5f1264f2f9b37055d90e83b55e609b Mon Sep 17 00:00:00 2001 From: Tomas Hozza Date: Mon, 7 Jul 2014 22:15:59 +0200 Subject: [PATCH] Fix checking of iconv_open return code. Based on libiconv documentation, the iconv_open function returns (iconv_t)(-1). Signed-off-by: Tomas Hozza --- src/ChangeLog | 4 ++++ src/iri.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 63603036..91eda5f0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2014-07-07 Tomas Hozza + + * iri.c (locale_to_utf8): Fix checking of iconv_open return code. + 2014-07-05 Darshit Shah * cookies.c (check_domain_match): Libpsl requires that all domain names diff --git a/src/iri.c b/src/iri.c index 9442e4e9..4db426ef 100644 --- a/src/iri.c +++ b/src/iri.c @@ -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"));