From: Paul Eggert Date: Wed, 6 Apr 2011 23:02:23 +0000 (-0700) Subject: * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~356^2~26 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7e2cac200108a4626573c4a8de851560c1fee456;p=emacs.git * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int. --- diff --git a/src/ChangeLog b/src/ChangeLog index ce97ca8204b..34e0e1b4cad 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 2011-04-06 Paul Eggert + * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int. + * xterm.c (x_catch_errors): Remove duplicate declaration. * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too. diff --git a/src/coding.c b/src/coding.c index 555c29cbdf3..798e5c533f6 100644 --- a/src/coding.c +++ b/src/coding.c @@ -9023,7 +9023,7 @@ Return the corresponding character. */) { Lisp_Object spec, attrs, val; struct charset *charset_roman, *charset_kanji, *charset_kana, *charset; - int c; + EMACS_INT c; CHECK_NATNUM (code); c = XFASTINT (code); @@ -9048,7 +9048,8 @@ Return the corresponding character. */) } else { - int c1 = c >> 8, c2 = c & 0xFF; + EMACS_INT c1 = c >> 8; + int c2 = c & 0xFF; if (c1 < 0x81 || (c1 > 0x9F && c1 < 0xE0) || c1 > 0xEF || c2 < 0x40 || c2 == 0x7F || c2 > 0xFC)