From f9fa352f109bb7f9b4314c57348d7eecfa2aa63c Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Fri, 5 May 1995 02:56:50 +0000 Subject: [PATCH] (doprnt): Handle long EMACS_INT in sprintf. --- src/doprnt.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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; -- 2.39.5