changeset 11700:79358a3240fe

(doprnt): Handle long EMACS_INT in sprintf.
author Richard M. Stallman <rms@gnu.org>
date Fri, 05 May 1995 02:56:50 +0000
parents eb4b842ee557
children d0eaa6b6dc72
files src/doprnt.c
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/doprnt.c	Fri May 05 02:56:20 1995 +0000
+++ b/src/doprnt.c	Fri May 05 02:56:50 1995 +0000
@@ -126,6 +126,16 @@
 	    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;