From: Bruno Haible Date: Mon, 12 May 2003 09:49:42 +0000 (+0000) Subject: Avoid a failure on strings longer than 4 KB. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=63dc1736288bf425917b06b2c7ad4931db9442f1;p=pspp Avoid a failure on strings longer than 4 KB. --- diff --git a/lib/ChangeLog b/lib/ChangeLog index d7cea73a82..70951b4610 100644 --- a/lib/ChangeLog +++ b/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-12 Jim Meyering * strftime.c (my_strftime): Let the `-' (no-pad) flag affect diff --git a/lib/linebreak.c b/lib/linebreak.c index 2274d160ae..c0ae082817 100644 --- a/lib/linebreak.c +++ b/lib/linebreak.c @@ -1379,7 +1379,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; }