From: Denys Vlasenko Date: Mon, 4 Mar 2013 02:04:38 +0000 (+0100) Subject: hostid: do not output sign-extended host id. Closes 6056 X-Git-Tag: 1.22.1~249 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9bbf6b98c42a212b8a4b1aa02975ac18bb612922;p=platform%2Fupstream%2Fbusybox.git hostid: do not output sign-extended host id. Closes 6056 Signed-off-by: Denys Vlasenko --- diff --git a/coreutils/hostid.c b/coreutils/hostid.c index 5c1a4e0..e5b1f51 100644 --- a/coreutils/hostid.c +++ b/coreutils/hostid.c @@ -36,7 +36,8 @@ int hostid_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) bb_show_usage(); } - printf("%08lx\n", gethostid()); + /* POSIX says gethostid returns a "32-bit identifier" */ + printf("%08x\n", (unsigned)(uint32_t)gethostid()); return fflush_all(); }