]> git.eshelyaron.com Git - emacs.git/commitdiff
(doprnt): Handle long EMACS_INT in sprintf.
authorRichard M. Stallman <rms@gnu.org>
Fri, 5 May 1995 02:56:50 +0000 (02:56 +0000)
committerRichard M. Stallman <rms@gnu.org>
Fri, 5 May 1995 02:56:50 +0000 (02:56 +0000)
src/doprnt.c

index 1743c785f010ac325f474a2af0647bd9fabbda20..39562af19fa65d7384ef7db2e8b57759a692b024 100644 (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;