summaryrefslogtreecommitdiff
path: root/src/doprnt.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1995-05-05 02:56:50 +0000
committerRichard M. Stallman <rms@gnu.org>1995-05-05 02:56:50 +0000
commitf9fa352f109bb7f9b4314c57348d7eecfa2aa63c (patch)
tree6e9e68cc7dcb8fb76d5d5ad77f0777db97bc0b8c /src/doprnt.c
parentfaca07fb62cb8a202972700054d2939401cfa778 (diff)
downloademacs-f9fa352f109bb7f9b4314c57348d7eecfa2aa63c.tar.gz
(doprnt): Handle long EMACS_INT in sprintf.
Diffstat (limited to 'src/doprnt.c')
-rw-r--r--src/doprnt.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/doprnt.c b/src/doprnt.c
index 1743c785f01..39562af19fa 100644
--- a/src/doprnt.c
+++ b/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;