From: Richard M. Stallman Date: Fri, 5 May 1995 02:55:21 +0000 (+0000) Subject: (Fexecute_extended_command): Handle long EMACS_INT in sprintf. X-Git-Tag: emacs-19.34~4160 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5d5b907f9a2bf2ccf7e99ff658c78ebacb4dee65;p=emacs.git (Fexecute_extended_command): Handle long EMACS_INT in sprintf. --- diff --git a/src/keyboard.c b/src/keyboard.c index a387edb3e06..df29e33c75a 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -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