bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patch] 5.2.1 (hostid): don't display sign-extended part


From: Tim Waugh
Subject: [patch] 5.2.1 (hostid): don't display sign-extended part
Date: Thu, 16 Jun 2005 11:58:49 +0100
User-agent: Mutt/1.4.2.1i

Hi,

The gethostid() function returns a long int, and on 64-bit platforms
this can mean that the 32-bit value becomes sign-extended.  Here is a
patch to only display the 32-bit value in hostid().

Original bug report:

  https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=160078

Tim.
*/

--- coreutils-5.2.1/src/hostid.c.no-sign-extend 2005-06-16 11:33:54.000000000 
+0100
+++ coreutils-5.2.1/src/hostid.c        2005-06-16 11:34:18.000000000 +0100
@@ -80,7 +80,7 @@
     }
 
   id = gethostid ();
-  printf ("%lx\n", id);
+  printf ("%8x\n", id);
 
   exit (EXIT_SUCCESS);
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]