diff options
author | Ulrich Drepper <drepper@redhat.com> | 2002-04-20 01:48:12 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2002-04-20 01:48:12 +0000 |
commit | d7eef2185d65626f06e0349f35bfd4317ba7d4f8 (patch) | |
tree | 9a79ee98dafb71653d9089b706744f5eaa3f7e9d /iconvdata | |
parent | b32b5f08158e76b8c2d8b584169cbb56819a3555 (diff) | |
download | glibc-d7eef2185d65626f06e0349f35bfd4317ba7d4f8.tar.gz glibc-d7eef2185d65626f06e0349f35bfd4317ba7d4f8.tar.xz glibc-d7eef2185d65626f06e0349f35bfd4317ba7d4f8.zip |
BODY for FROM_LOOP): When encountering an invalid input (e.g. a byte > 0x80
followed by a byte < 0x80), skip always one byte, not 0 bytes in some cases and 2 bytes in others.
Diffstat (limited to 'iconvdata')
-rw-r--r-- | iconvdata/euc-jp.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/iconvdata/euc-jp.c b/iconvdata/euc-jp.c index 1a638994a3..3c55e440b2 100644 --- a/iconvdata/euc-jp.c +++ b/iconvdata/euc-jp.c @@ -63,12 +63,12 @@ else \ { \ /* Two or more byte character. First test whether the next \ - character is also available. */ \ + byte is also available. */ \ int ch2; \ \ if (__builtin_expect (inptr + 1 >= inend, 0)) \ { \ - /* The second character is not available. Store the \ + /* The second byte is not available. Store the \ intermediate result. */ \ result = __GCONV_INCOMPLETE_INPUT; \ break; \ @@ -104,6 +104,10 @@ result = __GCONV_ILLEGAL_INPUT; \ break; \ } \ + \ + ++inptr; \ + ++*irreversible; \ + continue; \ } \ \ inptr += 2; \ @@ -143,7 +147,7 @@ break; \ } \ \ - inptr += 2; \ + ++inptr; \ ++*irreversible; \ continue; \ } \ |