patch for strings(1) offset format problem (sign flips every 2GB)

Previous thread: Expert3D-Lite driver breakage by Edd Barrett on Thursday, September 3, 2009 - 10:04 am. (6 messages)

Next thread: wsmoused(8) high-speed motion fix by Jeff Quast on Friday, September 4, 2009 - 6:24 am. (1 message)
From: Carson Harding
Date: Thursday, September 3, 2009 - 12:18 pm

This seems to fix the issue where the sign flips on the offset when
running on files > 2GB (-t option). Printf(3) says "L" modifies
floating point formats, use "ll" for integers. Should be unsigned as
well. 


--- ./gnu/usr.bin/binutils/binutils/strings.c.orig	Wed Sep  2 13:59:16 2009
+++ ./gnu/usr.bin/binutils/binutils/strings.c	Wed Sep  2 14:54:06 2009
@@ -522,7 +522,7 @@
 	  case 8:
 #if __STDC_VERSION__ >= 199901L || (defined(__GNUC__) && __GNUC__ >= 2)
 	    if (sizeof (start) > sizeof (long))
-	      printf ("%7Lo ", (unsigned long long) start);
+	      printf ("%7llo ", (unsigned long long) start);
 	    else
 #else
 # if !BFD_HOST_64BIT_LONG
@@ -537,7 +537,7 @@
 	  case 10:
 #if __STDC_VERSION__ >= 199901L || (defined(__GNUC__) && __GNUC__ >= 2)
 	    if (sizeof (start) > sizeof (long))
-	      printf ("%7Ld ", (unsigned long long) start);
+	      printf ("%7llu ", (unsigned long long) start);
 	    else
 #else
 # if !BFD_HOST_64BIT_LONG
@@ -552,7 +552,7 @@
 	  case 16:
 #if __STDC_VERSION__ >= 199901L || (defined(__GNUC__) && __GNUC__ >= 2)
 	    if (sizeof (start) > sizeof (long))
-	      printf ("%7Lx ", (unsigned long long) start);
+	      printf ("%7llx ", (unsigned long long) start);
 	    else
 #else
 # if !BFD_HOST_64BIT_LONG


-- 
Carson Harding - harding (at) motd (dot) ca

Previous thread: Expert3D-Lite driver breakage by Edd Barrett on Thursday, September 3, 2009 - 10:04 am. (6 messages)

Next thread: wsmoused(8) high-speed motion fix by Jeff Quast on Friday, September 4, 2009 - 6:24 am. (1 message)