From: Ulrich Drepper Date: Tue, 28 Dec 1999 04:54:05 +0000 (+0000) Subject: In mapping from UCS4: don't crash for undefined mappings. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=47b4325a420dbc51aea156b617cf53a6231d04f2;p=thirdparty%2Fglibc.git In mapping from UCS4: don't crash for undefined mappings. --- diff --git a/iconvdata/gbk.c b/iconvdata/gbk.c index 793034b02cc..8e8d7b25f6b 100644 --- a/iconvdata/gbk.c +++ b/iconvdata/gbk.c @@ -5549,7 +5549,7 @@ static const char __gbk_from_ucs4_tab1[][2] = [0x0044] = "\xa8\xa8", [0x0045] = "\xa8\xa6", [0x0046] = "\xa8\xba", [0x0048] = "\xa8\xac", [0x0049] = "\xa8\xaa", [0x004e] = "\xa8\xb0", [0x004f] = "\xa8\xae", [0x0053] = "\xa1\xc2", [0x0055] = "\xa8\xb4", - [0x0056] = "\xa8\xb2", [0x0058] = "\xa8\xb9", + [0x0056] = "\xa8\xb2", [0x0058] = "\xa8\xb9", [0x005d] = "\xa8\xa1" }; /* The table can be created using @@ -13190,12 +13190,9 @@ static const char __gbk_from_ucs4_tab12[][2] = { \ switch (ch) \ { \ - case 0xa4 ... 0x100: \ + case 0xa4 ... 0x101: \ cp = __gbk_from_ucs4_tab1[ch - 0xa4]; \ break; \ - case 0x101: \ - cp = "\xa8\xa1"; \ - break; \ case 0x113: \ cp = "\xa8\xa5"; \ break; \ @@ -13455,7 +13452,7 @@ static const char __gbk_from_ucs4_tab12[][2] = cp = ""; \ break; \ } \ - if (cp[0] == '\0' && ch != 0) \ + if (cp == NULL || (cp[0] == '\0' && ch != 0)) \ { \ /* Illegal character. */ \ result = GCONV_ILLEGAL_INPUT; \