From 918b9d72a9980efd4622bd25506da9531a952dbe Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 25 Apr 1998 20:34:34 +0000 Subject: Update. 1998-04-25 18:39 Ulrich Drepper * iconvdata/Makefile: Use gap method for iso8859-5, iso8859-7, iso8859-8 and iso8859-10. * iconvdata/iso8859-5.c: Change to use gap method. * iconvdata/iso8859-7.c: Likewise. * iconvdata/iso8859-8.c: Likewise. * iconvdata/iso8859-10.c: Likewise. * iconvdata/Makefile: Add rules for ISO-2022-JP module. * iconv/skeleton.c: Allow END_LOOP do be defined and use it at the end of the loop. * iconvdata/iso-2022-jp.c: New file. * iconvdata/ksc5601.c: Don't use uint16_t to represent byte sequence. * iconvdata/ksc5601.h: Unify function interfaces. * iconvdata/euckr.c: Adapt for changed ksc5601.h interface. * iconvdata/uhc.c: Likewise. * iconvdata/gb2312.h: Use correct types. * iconvdata/iso646.c (gconv_open): Correctly initialize the character size elements of data. --- iconvdata/uhc.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'iconvdata/uhc.c') diff --git a/iconvdata/uhc.c b/iconvdata/uhc.c index 9c0b668..0d09f4a 100644 --- a/iconvdata/uhc.c +++ b/iconvdata/uhc.c @@ -2689,11 +2689,19 @@ uhc_from_ucs4 (uint32_t ch, unsigned char *cp) + (ch < 0xa1 \ ? (ch - 0x81) * 178 \ : 5696 + (ch - 0xa1) * 84)]; \ + \ + if (ch == 0) \ + { \ + /* This is an illegal character. */ \ + result = GCONV_ILLEGAL_INPUT; \ + break; \ + } \ + \ + inptr += 2; \ } \ else \ { \ - ch = ksc5601_to_ucs4 ((ch * 256 + ch2) & 0x7f7f); \ - \ + ch = ksc5601_to_ucs4 (&inptr, 2, 0x80); if (ch == UNKNOWN_10646_CHAR) \ { \ /* Illegal. */ \ @@ -2701,15 +2709,6 @@ uhc_from_ucs4 (uint32_t ch, unsigned char *cp) break; \ } \ } \ - \ - if (ch == 0) \ - { \ - /* This is an illegal character. */ \ - result = GCONV_ILLEGAL_INPUT; \ - break; \ - } \ - \ - inptr += 2; \ } \ \ *((uint32_t *) outptr)++ = ch; \ -- cgit v1.1