diff --git a/src/iri.c b/src/iri.c index dc9aa9ad..6c6e8d34 100644 --- a/src/iri.c +++ b/src/iri.c @@ -146,7 +146,8 @@ do_conversion (const char *tocode, const char *fromcode, char const *in_org, siz for (;;) { - if (iconv (cd, &in, &inlen, out, &outlen) != (size_t)(-1)) + if (iconv (cd, &in, &inlen, out, &outlen) != (size_t)(-1) && + iconv (cd, NULL, NULL, out, &outlen) != (size_t)(-1)) { *out = s; *(s + len - outlen - done) = '\0';