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:
parent
faca07fb62
commit
f9fa352f10
10
src/doprnt.c
10
src/doprnt.c
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user