# HG changeset patch # User Bruno Haible # Date 1052732982 0 # Node ID ad1a5733db167419de5ce27a6422ac80c72c68c8 # Parent 05d392fdaa43e7ccecad28c232d7031d58eaf89e Avoid a failure on strings longer than 4 KB. diff --git a/lib/ChangeLog b/lib/ChangeLog --- 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 --- a/lib/linebreak.c +++ b/lib/linebreak.c @@ -1379,7 +1379,7 @@ 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; }