* coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 6 Apr 2011 23:02:23 +0000 (16:02 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 6 Apr 2011 23:02:23 +0000 (16:02 -0700)
src/ChangeLog
src/coding.c

index ce97ca8..34e0e1b 100644 (file)
@@ -1,5 +1,7 @@
 2011-04-06  Paul Eggert  <eggert@cs.ucla.edu>
 
+       * 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.
index 555c29c..798e5c5 100644 (file)
@@ -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)