1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-18 18:05:07 +00:00

(doprnt): Handle long EMACS_INT in sprintf.

This commit is contained in:
Richard M. Stallman 1995-05-05 02:56:50 +00:00
parent faca07fb62
commit f9fa352f10

View File

@ -126,6 +126,16 @@ doprnt (buffer, bufsize, format, format_end, nargs, args)
case 'x':
if (cnt == nargs)
error ("not enough arguments for format string");
if (sizeof (int) == sizeof (EMACS_INT))
;
else if (sizeof (long) == sizeof (EMACS_INT))
/* Insert an `l' the right place. */
string[1] = string[0],
string[0] = string[-1],
string[-1] = 'l',
string++;
else
abort ();
sprintf (sprintf_buffer, fmtcpy, args[cnt++]);
/* Now copy into final output, truncating as nec. */
string = sprintf_buffer;