diff options
author | Ulrich Drepper <drepper@redhat.com> | 2005-09-23 18:48:38 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2005-09-23 18:48:38 +0000 |
commit | 294bda1b5a42d485ba39f59c05a25e542eb7fa0d (patch) | |
tree | ba124d55d4f236d1a847cdc71342fdb2d5fda82b /iconvdata/jis0208.h | |
parent | 32053042d4785ffeae3a032808480c8dc2f98607 (diff) | |
download | glibc-294bda1b5a42d485ba39f59c05a25e542eb7fa0d.tar.gz glibc-294bda1b5a42d485ba39f59c05a25e542eb7fa0d.tar.xz glibc-294bda1b5a42d485ba39f59c05a25e542eb7fa0d.zip |
[BZ #395]
* iconvdata/jis0208.c (__jisx0208_from_ucs4_lat1): Reduce size of array. * iconvdata/jis0208.h (ucs4_to_jisx0208): Adjust access. 2004-08-13 GOTO Masanori <gotom@debian.or.jp> [BZ #395] * iconvdata/jis0208.c: Remove 0x005C mapping from __jisx0208_from_ucs4_lat1. Reported by Fumitoshi UKAI <ukai@debian.or.jp> 2005-09-23 Ulrich Drepper <drepper@redhat.com>
Diffstat (limited to 'iconvdata/jis0208.h')
-rw-r--r-- | iconvdata/jis0208.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/iconvdata/jis0208.h b/iconvdata/jis0208.h index 8255bafc62..329e30f9b2 100644 --- a/iconvdata/jis0208.h +++ b/iconvdata/jis0208.h @@ -36,7 +36,10 @@ struct jisx0208_ucs_idx /* Conversion table. */ extern const uint16_t __jis0208_to_ucs[]; -extern const char __jisx0208_from_ucs4_lat1[256][2]; +#define JIS0208_LAT1_MIN 0xa2 +#define JIS0208_LAT1_MAX 0xf7 +extern const char __jisx0208_from_ucs4_lat1[JIS0208_LAT1_MAX + 1 + - JIS0208_LAT1_MIN][2]; extern const char __jisx0208_from_ucs4_greek[0xc1][2]; extern const struct jisx0208_ucs_idx __jisx0208_from_ucs_idx[]; extern const char __jisx0208_from_ucs_tab[][2]; @@ -80,8 +83,8 @@ ucs4_to_jisx0208 (uint32_t wch, char *s, size_t avail) if (avail < 2) return 0; - if (ch < 0x100) - cp = __jisx0208_from_ucs4_lat1[ch]; + if (ch >= JIS0208_LAT1_MIN && ch <= JIS0208_LAT1_MAX) + cp = __jisx0208_from_ucs4_lat1[ch - JIS0208_LAT1_MIN]; else if (ch >= 0x391 && ch <= 0x451) cp = __jisx0208_from_ucs4_greek[ch - 0x391]; else |