changeset 72584:ad48859287a7

(Fformat): Don't sign-extend for %o or %x.
author Richard M. Stallman <rms@gnu.org>
date Thu, 31 Aug 2006 23:07:39 +0000
parents 9d318ca86e6e
children effa5e13d289
files src/editfns.c
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/editfns.c	Thu Aug 31 23:04:42 2006 +0000
+++ b/src/editfns.c	Thu Aug 31 23:07:39 2006 +0000
@@ -3758,7 +3758,13 @@
 	      this_format[format - this_format_start] = 0;
 
 	      if (INTEGERP (args[n]))
-		sprintf (p, this_format, XINT (args[n]));
+		{
+		  if (format[-1] == 'd')
+		    sprintf (p, this_format, XINT (args[n]));
+		  /* Don't sign-extend for octal or hex printing.  */
+		  else
+		    sprintf (p, this_format, XUINT (args[n]));
+		}
 	      else
 		sprintf (p, this_format, XFLOAT_DATA (args[n]));