]> git.eshelyaron.com Git - emacs.git/commitdiff
(Fexecute_extended_command): Handle long EMACS_INT in sprintf.
authorRichard M. Stallman <rms@gnu.org>
Fri, 5 May 1995 02:55:21 +0000 (02:55 +0000)
committerRichard M. Stallman <rms@gnu.org>
Fri, 5 May 1995 02:55:21 +0000 (02:55 +0000)
src/keyboard.c

index a387edb3e06f7c1b44f1a93d10e0ebfb4b00da8b..df29e33c75a831ad7d55388a42ebcd3717f56508 100644 (file)
@@ -6054,9 +6054,23 @@ DEFUN ("execute-extended-command", Fexecute_extended_command, Sexecute_extended_
   else if (CONSP (prefixarg) && XINT (XCONS (prefixarg)->car) == 4)
     strcpy (buf, "C-u ");
   else if (CONSP (prefixarg) && INTEGERP (XCONS (prefixarg)->car))
-    sprintf (buf, "%d ", XINT (XCONS (prefixarg)->car));
+    {
+      if (sizeof (int) == sizeof (EMACS_INT))
+       sprintf (buf, "%d ", XINT (XCONS (prefixarg)->car));
+      else if (sizeof (long) == sizeof (EMACS_INT))
+       sprintf (buf, "%ld ", XINT (XCONS (prefixarg)->car));
+      else
+       abort ();
+    }
   else if (INTEGERP (prefixarg))
-    sprintf (buf, "%d ", XINT (prefixarg));
+    {
+      if (sizeof (int) == sizeof (EMACS_INT))
+       sprintf (buf, "%d ", XINT (prefixarg));
+      else if (sizeof (long) == sizeof (EMACS_INT))
+       sprintf (buf, "%ld ", XINT (prefixarg));
+      else
+       abort ();
+    }
 
   /* This isn't strictly correct if execute-extended-command
      is bound to anything else.  Perhaps it should use