diff options
Diffstat (limited to 'macros/texinfo/texinfo/info/util.c')
-rw-r--r-- | macros/texinfo/texinfo/info/util.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/macros/texinfo/texinfo/info/util.c b/macros/texinfo/texinfo/info/util.c index 10be93bae1..46af4ce385 100644 --- a/macros/texinfo/texinfo/info/util.c +++ b/macros/texinfo/texinfo/info/util.c @@ -350,11 +350,11 @@ text_buffer_iconv (struct text_buffer *buf, iconv_t iconv_state, 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); - while (1) { + outptr = text_buffer_base (buf) + text_buffer_off (buf); + out_bytes_left = text_buffer_space_left (buf); + iconv_ret = iconv (iconv_state, inbuf, inbytesleft, &outptr, &out_bytes_left); if (iconv_ret != (size_t) -1) @@ -362,10 +362,7 @@ 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, (extra_alloc *= 4)); - out_bytes_left = text_buffer_space_left (buf); - } + text_buffer_alloc (buf, (extra_alloc *= 4)); else break; /* let calling code deal with it */ } |