From: Jakub Wilk Date: Fri, 11 Sep 2020 11:44:46 +0000 (+0200) Subject: bswap.3: Use strtoull() for parsing 64-bit numbers X-Git-Tag: man-pages-5.09~372 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=581c3ea730feb635f0670a372c4eedae22e555c8;p=thirdparty%2Fman-pages.git bswap.3: Use strtoull() for parsing 64-bit numbers Before, on 32-bit systems: $ ./a.out 0x0123456789abcdef 0xffffffff ==> 0xffffffff00000000 After: $ ./a.out 0x0123456789abcdef 0x123456789abcdef ==> 0xefcdab8967452301 Signed-off-by: Jakub Wilk Signed-off-by: Michael Kerrisk --- diff --git a/man3/bswap.3 b/man3/bswap.3 index 412e1702f5..ce847580aa 100644 --- a/man3/bswap.3 +++ b/man3/bswap.3 @@ -72,7 +72,7 @@ main(int argc, char *argv[]) exit(EXIT_FAILURE); } - x = strtoul(argv[1], NULL, 0); + x = strtoull(argv[1], NULL, 0); printf("0x%" PRIx64 " ==> 0x%" PRIx64 "\en", x, bswap_64(x)); exit(EXIT_SUCCESS);