aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--util-linux/hexdump.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/util-linux/hexdump.c b/util-linux/hexdump.c
index c46ffeca7..5a938e783 100644
--- a/util-linux/hexdump.c
+++ b/util-linux/hexdump.c
@@ -127,15 +127,20 @@ int hexdump_main(int argc, char **argv)
127 if (ch == 'f') { 127 if (ch == 'f') {
128 bb_dump_addfile(dumper, optarg); 128 bb_dump_addfile(dumper, optarg);
129 } /* else */ 129 } /* else */
130 if (ch == 'n') { 130 if (ch == 'n') { /* compat: -n accepts hex numbers too */
131 dumper->dump_length = xatoi_positive(optarg); 131 dumper->dump_length = xstrtou_range_sfx(
132 optarg,
133 /*base:*/ 0,
134 /*lo:*/ 0, /*hi:*/ INT_MAX,
135 kmg_i_suffixes
136 );
132 } /* else */ 137 } /* else */
133 if (ch == 's') { /* compat: -s accepts hex numbers too */ 138 if (ch == 's') { /* compat: -s accepts hex numbers too */
134 dumper->dump_skip = xstrtoull_range_sfx( 139 dumper->dump_skip = xstrtoull_range_sfx(
135 optarg, 140 optarg,
136 /*base:*/ 0, 141 /*base:*/ 0,
137 /*lo:*/ 0, /*hi:*/ OFF_T_MAX, 142 /*lo:*/ 0, /*hi:*/ OFF_T_MAX,
138 bkm_suffixes 143 kmg_i_suffixes
139 ); 144 );
140 } /* else */ 145 } /* else */
141 if (ch == 'v') { 146 if (ch == 'v') {