summaryrefslogtreecommitdiff
path: root/src/charset/codecs/codec_utf8.c
diff options
context:
space:
mode:
authorFran├žois Revel <mmu_man@netsurf-browser.org>2008-11-29 23:26:03 +0000
committerFran├žois Revel <mmu_man@netsurf-browser.org>2008-11-29 23:26:03 +0000
commit305940a1a9430c381d04dc181f61123fa80ab74f (patch)
tree7607a648ddfe085db6a719ac45ae97b5aa18b058 /src/charset/codecs/codec_utf8.c
parent50e64e8710e3af657ad97053e16435c284dc80e2 (diff)
downloadlibparserutils-305940a1a9430c381d04dc181f61123fa80ab74f.tar.gz
libparserutils-305940a1a9430c381d04dc181f61123fa80ab74f.tar.bz2
C89
svn path=/trunk/libparserutils/; revision=5839
Diffstat (limited to 'src/charset/codecs/codec_utf8.c')
-rw-r--r--src/charset/codecs/codec_utf8.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/charset/codecs/codec_utf8.c b/src/charset/codecs/codec_utf8.c
index f39b8bb..f9cd00a 100644
--- a/src/charset/codecs/codec_utf8.c
+++ b/src/charset/codecs/codec_utf8.c
@@ -182,11 +182,12 @@ parserutils_error charset_utf8_codec_encode(parserutils_charset_codec *codec,
while (c->write_len > 0) {
UTF8_FROM_UCS4(pwrite[0], dest, destlen, error);
if (error != PARSERUTILS_OK) {
+ uint32_t len;
if (error != PARSERUTILS_NOMEM)
abort();
/* Insufficient output buffer space */
- for (uint32_t len = 0;
+ for (len = 0;
len < c->write_len; len++) {
c->write_buf[len] = pwrite[len];
}
@@ -209,6 +210,7 @@ parserutils_error charset_utf8_codec_encode(parserutils_charset_codec *codec,
while (towritelen > 0) {
UTF8_FROM_UCS4(towrite[0], dest, destlen, error);
if (error != PARSERUTILS_OK) {
+ uint32_t len;
if (error != PARSERUTILS_NOMEM)
abort();
@@ -220,7 +222,7 @@ parserutils_error charset_utf8_codec_encode(parserutils_charset_codec *codec,
/* Copy pending chars to save area, for
* processing next call. */
- for (uint32_t len = 0; len < towritelen; len++)
+ for (len = 0; len < towritelen; len++)
c->write_buf[len] = towrite[len];
/* Claim character we've just buffered,