od(1): Fix long ints (L) format output on x86_64 platform
authordczheng <dczheng21@outlook.com>
Mon, 15 Mar 2021 17:11:04 +0000 (17:11 +0000)
committerAaron LI <aly@aaronly.me>
Tue, 16 Mar 2021 13:22:58 +0000 (21:22 +0800)
commitfc57cf9eef1482add27630b7c6d7ec8005b48da2
treed0d76e0429f508fc4e5e49cc643f55a376a3b333
parentfae36b11104b8205e65c6683845a4be9902ff63f
od(1): Fix long ints (L) format output on x86_64 platform

Long ints are of size 8 bytes on x86_64 platform, and the handle of
8-byte integers was missing in od(1)/hexdump(1).  So using '-t [doux]L'
(long ints) options in od(1) resulted in error:

od: d: bad byte count

Update the parse code to handle 8-byte long integers to fix it, and
update odformatint() to correctly calculate the digits.
In addition, fix the type error of 's8' (int8_t -> int64_t) in print(),
otherwise, long ints are truncated and get wrong.

Reported-by: swildner
usr.bin/hexdump/display.c
usr.bin/hexdump/odsyntax.c
usr.bin/hexdump/parse.c