aboutsummaryrefslogtreecommitdiff
path: root/iconvdata/ansi_x3.110.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-12-08 04:56:09 +0000
committerUlrich Drepper <drepper@redhat.com>1999-12-08 04:56:09 +0000
commit3b187ccb86c5ad5fe969f788d8a635e9f7bbdc5f (patch)
treeedcb5e88e045694c8cd7ee4d25c6c87931c828fe /iconvdata/ansi_x3.110.c
parent76a2102b0874ed777309caf846b5f4d021bb830d (diff)
downloadglibc-3b187ccb86c5ad5fe969f788d8a635e9f7bbdc5f.zip
glibc-3b187ccb86c5ad5fe969f788d8a635e9f7bbdc5f.tar.gz
glibc-3b187ccb86c5ad5fe969f788d8a635e9f7bbdc5f.tar.bz2
Update.
* iconvdata/ansi_x3.110.c (from_ansi_x3_110): Don't increment pointers if character is illegal. Reported by Bruno Haible <haible@ilog.fr>. Reported by Bruno Haible <haible@ilog.fr>.
Diffstat (limited to 'iconvdata/ansi_x3.110.c')
-rw-r--r--iconvdata/ansi_x3.110.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/iconvdata/ansi_x3.110.c b/iconvdata/ansi_x3.110.c
index 9371c5a..35658b5 100644
--- a/iconvdata/ansi_x3.110.c
+++ b/iconvdata/ansi_x3.110.c
@@ -399,6 +399,7 @@ static const char from_ucs4[][2] =
#define BODY \
{ \
uint32_t ch = *inptr; \
+ int incr; \
\
if (ch >= 0xc1 && ch <= 0xcf) \
{ \
@@ -424,12 +425,12 @@ static const char from_ucs4[][2] =
\
ch = to_ucs4_comb[ch - 0xc1][ch2 - 0x20]; \
\
- inptr += 2; \
+ incr = 2; \
} \
else \
{ \
ch = to_ucs4[ch]; \
- ++inptr; \
+ incr = 1; \
} \
\
if (ch == 0 && *inptr != '\0') \
@@ -439,6 +440,7 @@ static const char from_ucs4[][2] =
break; \
} \
\
+ inptr += incr; \
*((uint32_t *) outptr)++ = ch; \
}
#include <iconv/loop.c>