* src/hostid.c (main): Declare variables where they are used instead of
at the start of the function.
int
main (int argc, char **argv)
{
- unsigned int id;
-
initialize_main (&argc, &argv);
set_program_name (argv[0]);
setlocale (LC_ALL, "");
usage (EXIT_FAILURE);
}
- id = gethostid ();
-
/* POSIX says gethostid returns a "32-bit identifier" but is silent
whether it's sign-extended. Turn off any sign-extension. This
is a no-op unless unsigned int is wider than 32 bits. */
- id &= 0xffffffff;
+ unsigned int id = gethostid () & 0xffffffff;
printf ("%08x\n", id);