From b79f74cd622578ce5eea1a3ed5840ac53d6b6d93 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 5 Sep 2000 02:41:25 +0000 Subject: Update. 2000-09-03 Bruno Haible * charmaps/EUC-TW: Add commented non-reversible mappings. 2000-09-03 Bruno Haible * charmaps/CP949: New file. 2000-09-03 Bruno Haible * charmaps/GB2312: Remove 0x80..0xA0, 0xAA..0xAF, 0xF8..FF. 2000-09-03 Bruno Haible * charmaps/EUC-JP: Nonreversibly map 0xA1C0 to U+005C and 0x8FA2B7 to U+007E. --- iconvdata/euc-tw.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'iconvdata/euc-tw.c') diff --git a/iconvdata/euc-tw.c b/iconvdata/euc-tw.c index ed7a197d7c..39c2f1f7da 100644 --- a/iconvdata/euc-tw.c +++ b/iconvdata/euc-tw.c @@ -65,7 +65,7 @@ character is also available. */ \ uint32_t ch2; \ \ - if (inptr + (ch == 0x8e ? 3 : 1) >= inend) \ + if (inptr + 1 >= inend) \ { \ /* The second character is not available. Store the \ intermediate result. */ \ @@ -73,7 +73,7 @@ break; \ } \ \ - ch2 = *inptr; \ + ch2 = *(inptr + 1); \ \ /* All second bytes of a multibyte character must be >= 0xa1. */ \ if (ch2 < 0xa1 || ch2 == 0xff) \ @@ -96,8 +96,15 @@ const char *endp = inptr + 1; \ \ ch = cns11643_to_ucs4 (&endp, inend - inptr - 1, 0x80); \ - /* Please note that we need not test for the missing input \ - characters here anymore. */ \ + \ + if (ch == 0) \ + { \ + /* The third or fourth character is not available. Store \ + the intermediate result. */ \ + result = __GCONV_INCOMPLETE_INPUT; \ + break; \ + } \ + \ if (ch == __UNKNOWN_10646_CHAR) \ { \ /* Illegal input. */ \ -- cgit v1.2.3