comparison src/coding.c @ 68567:ae0affba29c8

(decode_composition_emacs_mule): Fix handling of incorrect format data.
author Kenichi Handa <handa@m17n.org>
date Thu, 02 Feb 2006 12:46:51 +0000
parents 547f2b420666
children 3bd95f4f2941 49f9dd4bb117 d6f8fe3307c8
comparison
equal deleted inserted replaced
68566:15866c79c059 68567:ae0affba29c8
870 src += bytes; 870 src += bytes;
871 } 871 }
872 component[ncomponent] = c; 872 component[ncomponent] = c;
873 } 873 }
874 } 874 }
875 else 875 else if (c >= 0x80)
876 { 876 {
877 /* This may be an old Emacs 20 style format. See the comment at 877 /* This may be an old Emacs 20 style format. See the comment at
878 the section 2 of this file. */ 878 the section 2 of this file. */
879 while (src < src_end && !CHAR_HEAD_P (*src)) src++; 879 while (src < src_end && !CHAR_HEAD_P (*src)) src++;
880 if (src == src_end 880 if (src == src_end
922 nchars = (ncomponent + 1) / 2; 922 nchars = (ncomponent + 1) / 2;
923 } 923 }
924 else 924 else
925 return 0; 925 return 0;
926 } 926 }
927 else
928 return 0;
927 929
928 if (buf == bufp || dst + (bufp - buf) <= (dst_bytes ? dst_end : src)) 930 if (buf == bufp || dst + (bufp - buf) <= (dst_bytes ? dst_end : src))
929 { 931 {
930 CODING_ADD_COMPOSITION_START (coding, coding->produced_char, method); 932 CODING_ADD_COMPOSITION_START (coding, coding->produced_char, method);
931 for (i = 0; i < ncomponent; i++) 933 for (i = 0; i < ncomponent; i++)