From: tomo Date: Fri, 1 Oct 1999 05:57:46 +0000 (+0000) Subject: (MAKE_CHAR): Check the result for range-represented charset. X-Git-Tag: r21-2-19-utf-2000-0_8-2~22 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83672a528db7fe9cace421905b7efd06c11b7c98;p=chise%2Fxemacs-chise.git (MAKE_CHAR): Check the result for range-represented charset. --- diff --git a/src/char-ucs.h b/src/char-ucs.h index c51639d..42d98ef 100644 --- a/src/char-ucs.h +++ b/src/char-ucs.h @@ -393,13 +393,21 @@ MAKE_CHAR (Lisp_Object charset, int c1, int c2) /* return MIN_CHAR_94 + ('I' - '0') * 94 + (c1 - 33); */ return ' '; else if (XCHARSET_UCS_MAX (charset)) - return (XCHARSET_DIMENSION (charset) == 1 - ? - c1 - XCHARSET_BYTE_OFFSET (charset) - : - (c1 - XCHARSET_BYTE_OFFSET (charset)) * XCHARSET_CHARS (charset) - + c2 - XCHARSET_BYTE_OFFSET (charset)) - - XCHARSET_CODE_OFFSET (charset) + XCHARSET_UCS_MIN (charset); + { + Emchar code + = (XCHARSET_DIMENSION (charset) == 1 + ? + c1 - XCHARSET_BYTE_OFFSET (charset) + : + (c1 - XCHARSET_BYTE_OFFSET (charset)) * XCHARSET_CHARS (charset) + + c2 - XCHARSET_BYTE_OFFSET (charset)) + - XCHARSET_CODE_OFFSET (charset) + XCHARSET_UCS_MIN (charset); + if ((code < XCHARSET_UCS_MIN (charset)) + || (XCHARSET_UCS_MAX (charset) < code)) + signal_simple_error ("Arguments makes invalid character", + make_char (code)); + return code; + } else if (XCHARSET_DIMENSION (charset) == 1) { switch (XCHARSET_CHARS (charset))