]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
BODY for FROM_LOOP): When encountering an invalid input (e.g. a byte > 0x80
authorUlrich Drepper <drepper@redhat.com>
Sat, 20 Apr 2002 01:48:12 +0000 (01:48 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sat, 20 Apr 2002 01:48:12 +0000 (01:48 +0000)
followed by a byte < 0x80), skip always one byte, not 0 bytes in some cases
and 2 bytes in others.

iconvdata/euc-jp.c

index 1a638994a3163e8a0069eb559f47c57b303b18a0..3c55e440b21e406625c6b71f8ca1b22c444cd8c5 100644 (file)
     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;                                                            \
                    result = __GCONV_ILLEGAL_INPUT;                           \
                    break;                                                    \
                  }                                                           \
+                                                                             \
+               ++inptr;                                                      \
+               ++*irreversible;                                              \
+               continue;                                                     \
              }                                                               \
                                                                              \
            inptr += 2;                                                       \
                    break;                                                    \
                  }                                                           \
                                                                              \
-               inptr += 2;                                                   \
+               ++inptr;                                                      \
                ++*irreversible;                                              \
                continue;                                                     \
              }                                                               \