od: prefer signed types
commit08c325c63b28e1345f8a68af447d7a830c216e6e
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 31 Jul 2023 23:33:38 +0000 (31 16:33 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 1 Aug 2023 00:51:28 +0000 (31 17:51 -0700)
tree4429bfd929dcb70b74e56f4b30846b5e63df9d0b
parent89f7d44912e50ab038167c8f7192803e681664e4
od: prefer signed types

* src/od.c: Include stdckdint.h.
(bytes_to_oct_digits, bytes_to_signed_dec_digits)
(bytes_to_unsigned_dec_digits, bytes_to_hex_digits):
Use ‘char’ for these small constants.
(simple_strtoi): Rename from simple_strtoul.  Convert to int
instead of unsigned long; that’s good enough.  All uses changed.
Simplify by using ckd_mul and ckd_add to check for overflow.
(main): Prefer signed types to unsigned.
src/od.c