comparison src/coding.c @ 89481:4896b8834fb6

(decode_coding_sjis): Check bytes more rigidly.
author Kenichi Handa <handa@m17n.org>
date Wed, 09 Jul 2003 02:16:17 +0000
parents 7dbbe692f70c
children 2f877ed80fa6
comparison
equal deleted inserted replaced
89480:1640e9f749e1 89481:4896b8834fb6
3985 goto invalid_code; 3985 goto invalid_code;
3986 c = (c << 8) | c1; 3986 c = (c << 8) | c1;
3987 SJIS_TO_JIS (c); 3987 SJIS_TO_JIS (c);
3988 charset = charset_kanji; 3988 charset = charset_kanji;
3989 } 3989 }
3990 else 3990 else if (c > 0xA0)
3991 { 3991 {
3992 /* SJIS -> JISX0201-Kana */ 3992 /* SJIS -> JISX0201-Kana */
3993 c &= 0x7F; 3993 c &= 0x7F;
3994 charset = charset_kana; 3994 charset = charset_kana;
3995 } 3995 }
3996 else
3997 goto invalid_code;
3996 } 3998 }
3997 if (charset->id != charset_ascii 3999 if (charset->id != charset_ascii
3998 && last_id != charset->id) 4000 && last_id != charset->id)
3999 { 4001 {
4000 if (last_id != charset_ascii) 4002 if (last_id != charset_ascii)