changeset 4320:ad1a5733db16

Avoid a failure on strings longer than 4 KB.
author Bruno Haible <bruno@clisp.org>
date Mon, 12 May 2003 09:49:42 +0000
parents 05d392fdaa43
children 922a99576314
files lib/ChangeLog lib/linebreak.c
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,8 @@
+2003-05-10  Bruno Haible  <bruno@clisp.org>
+
+	* linebreak.c (iconv_string_length): Don't return -1 just because the
+	string is longer than 4 KB.
+
 2003-05-12  Jim Meyering  <jim@meyering.net>
 
 	* strftime.c (my_strftime): Let the `-' (no-pad) flag affect
--- 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;
     }