diff options
Diffstat (limited to 'macros/texinfo/texinfo/info/util.c')
-rw-r--r-- | macros/texinfo/texinfo/info/util.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/macros/texinfo/texinfo/info/util.c b/macros/texinfo/texinfo/info/util.c index d07262d19b..10be93bae1 100644 --- a/macros/texinfo/texinfo/info/util.c +++ b/macros/texinfo/texinfo/info/util.c @@ -348,6 +348,7 @@ text_buffer_iconv (struct text_buffer *buf, iconv_t iconv_state, size_t out_bytes_left; char *outptr; size_t iconv_ret; + size_t extra_alloc = 1; outptr = text_buffer_base (buf) + text_buffer_off (buf); out_bytes_left = text_buffer_space_left (buf); @@ -361,7 +362,10 @@ text_buffer_iconv (struct text_buffer *buf, iconv_t iconv_state, /* If we ran out of space, allocate more and try again. */ if (errno == E2BIG) - text_buffer_alloc (buf, 4); + { + text_buffer_alloc (buf, (extra_alloc *= 4)); + out_bytes_left = text_buffer_space_left (buf); + } else break; /* let calling code deal with it */ } |