Make od print valid addresses for offsets of 2^32 and larger. (cont'd)
authorJim Meyering <jim@meyering.net>
Sun, 3 Dec 2000 10:18:04 +0000 (10:18 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 3 Dec 2000 10:18:04 +0000 (10:18 +0000)
commitd183ecddcd77fe02ed158ee6470ff4a8192ed763
treeb8ba90d9e712aa39725f6571434bd7d5b541394c
parente30c09b4cb9b5e2d7a845029a98c40d61920a1ea
Make od print valid addresses for offsets of 2^32 and larger. (cont'd)

(MAX_ADDRESS_LENGTH): Don't hard-code as a literal.
Rather, define in terms of the type, off_t.
(string_min): Declare to be of type size_t.
(flag_dump_strings): Declare to be of type int.
(print_s_char): Declare the n_bytes parameter and the local, `i',
to be of type off_t.
(print_char): Likewise.
(print_s_short): Likewise.
(print_short): Likewise.
(print_int): Likewise.
(print_long): Likewise.
(print_long_long): Likewise.
(print_float): Likewise.
(print_double): Likewise.
(print_long_double): Likewise.
(dump_hexl_mode_trailer): Likewise.
(print_named_ascii): Likewise.
(print_ascii): Likewise.
(write_block): Likewise.
(print_ascii): Declare local, `print_function' with a prototype.
Change a few `>' comparisons to the equivalent `<' form.
(parse_options): Declare `tmp' to be of type uintmax_t.
Use xstrtoumax, not xstrtoul.
Fail if the specified offset if larger than OFF_T_MAX.
(dump_strings): Declare local `i' to be of type size_t.
Remove the now-unnecessary cast-to-off_t.
(main) [IF_LINT]: Initialize desired_width to avoid a warning.
Declare `tmp' to be of type uintmax_t.
Use xstrtoumax, not xstrtoul.
Fail if minimum string length is larger than SIZE_MAX.
Fail if specified width is larger than ULONG_MAX.
src/od.c