From: Bruno Haible Date: Mon, 12 May 2003 09:44:33 +0000 (+0000) Subject: Fix a bad bug with long strings. X-Git-Tag: v0.12~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ae75d07d2e58eedc512fa45bcc9a166d9b03c11;p=thirdparty%2Fgettext.git Fix a bad bug with long strings. --- diff --git a/gettext-tools/lib/ChangeLog b/gettext-tools/lib/ChangeLog index 7251b213d..58cf2ef95 100644 --- a/gettext-tools/lib/ChangeLog +++ b/gettext-tools/lib/ChangeLog @@ -1,3 +1,8 @@ +2003-05-10 Bruno Haible + + * linebreak.c (iconv_string_length): Don't return -1 just because the + string is longer than 4 KB. + 2003-05-09 Bruno Haible * error.c: Update from gnulib with modifications. diff --git a/gettext-tools/lib/linebreak.c b/gettext-tools/lib/linebreak.c index ec1d23fa2..a541a7735 100644 --- a/gettext-tools/lib/linebreak.c +++ b/gettext-tools/lib/linebreak.c @@ -1391,7 +1391,7 @@ iconv_string_length (iconv_t cd, const char *s, size_t n) char *outptr = tmpbuf; size_t outsize = TMPBUFSIZE; size_t res = iconv (cd, (ICONV_CONST char **) &inptr, &insize, &outptr, &outsize); - if (res == (size_t)(-1)) + if (res == (size_t)(-1) && errno != E2BIG) return (size_t)(-1); count += outptr - tmpbuf; }