From: handa Date: Tue, 30 Mar 2004 08:02:31 +0000 (+0000) Subject: (xfont_encode_char): Return MCHAR_INVALID_CODE if code X-Git-Tag: withdl~319 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1fb23731b3e6997bae909f4fb8738b68b524c155;p=m17n%2Fm17n-lib.git (xfont_encode_char): Return MCHAR_INVALID_CODE if code >= 0x10000. --- diff --git a/src/m17n-X.c b/src/m17n-X.c index 76093b1..abed3ca 100644 --- a/src/m17n-X.c +++ b/src/m17n-X.c @@ -810,12 +810,12 @@ xfont_encode_char (MRealizedFont *rfont, int c, unsigned code) unsigned min_byte1, max_byte1, min_byte2, max_byte2; int all_chars_exist; - if (rfont->status < 0) - return -1; + if (rfont->status < 0 || code >= 0x10000) + return MCHAR_INVALID_CODE; if (rfont->status == 0) { if (xfont_open (rfont) < 0) - return -1; + return MCHAR_INVALID_CODE; } xfont = (MXFontInfo *) rfont->info; f = xfont->f;