]> git.ipfire.org Git - thirdparty/coreutils.git/commit
od: prefer intmax_t to uintmax_t
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 26 Jun 2025 15:45:47 +0000 (08:45 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 29 Jun 2025 04:00:41 +0000 (21:00 -0700)
commit4d527dda583f6d3b0bd66364549472a5d98cef67
tree2f0d2670f8afa0c79984712dfe0a19054dae2254
parent66464e61f549e9f2fd35f82567345721798288f9
od: prefer intmax_t to uintmax_t

* src/od.c (MAX_ADDRESS_LENGTH, pseudo_offset, n_bytes_to_skip)
(max_bytes_to_format, end_offset, skip, format_address_none)
(format_address_std, format_address_paren, format_address_label)
(write_block, parse_old_offset, dump, dump_strings, main):
Prefer intmax_t to uintmax_t.  This makes no practical difference,
and lets -fsanitize=undefined check for signed integer overflow.
(skip, dump): Remove no-longer-needed casts.
(xstr2nonneg): New static function.  All callers of xstrtoumax
now call this function instead.
(main): Use ckd_add to detect signed integer overflow, since
the unsigned trick no longer works reliably.
Let xstrtol_fatal report the overflow, instead of doing
it by hand ourselves.
src/od.c