]> code.delx.au - gnu-emacs/commitdiff
(Fformat): Don't sign-extend for %o or %x.
authorRichard M. Stallman <rms@gnu.org>
Thu, 31 Aug 2006 23:07:39 +0000 (23:07 +0000)
committerRichard M. Stallman <rms@gnu.org>
Thu, 31 Aug 2006 23:07:39 +0000 (23:07 +0000)
src/editfns.c

index c43528c4863bc8c1ab703322e69d1ce4ccf000a3..e916b505fe8d866d0afdb70791abd389cc5aa445 100644 (file)
@@ -3758,7 +3758,13 @@ usage: (format STRING &rest OBJECTS)  */)
              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]));