diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2013-03-27 15:15:33 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2013-03-27 15:15:33 +0100 |
commit | ef6747e290d0456d140129f28283e0761713da2e (patch) | |
tree | b7bdf26c8e72e232cb8567bbbc2b1806ed3986ef | |
parent | 80a38ca11c3c9e0fdef07ad3fc908aa54afb4386 (diff) | |
download | busybox-w32-ef6747e290d0456d140129f28283e0761713da2e.tar.gz busybox-w32-ef6747e290d0456d140129f28283e0761713da2e.tar.bz2 busybox-w32-ef6747e290d0456d140129f28283e0761713da2e.zip |
hexdump: don't unconditionally limit the usable address range
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | libbb/dump.c | 2 | ||||
-rw-r--r-- | util-linux/hexdump.c | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/libbb/dump.c b/libbb/dump.c index 7e435643b..566881a78 100644 --- a/libbb/dump.c +++ b/libbb/dump.c | |||
@@ -333,7 +333,7 @@ static void do_skip(priv_dumper_t *dumper, const char *fname, int statok) | |||
333 | return; | 333 | return; |
334 | } | 334 | } |
335 | } | 335 | } |
336 | if (fseek(stdin, dumper->pub.dump_skip, SEEK_SET)) { | 336 | if (fseeko(stdin, dumper->pub.dump_skip, SEEK_SET)) { |
337 | bb_simple_perror_msg_and_die(fname); | 337 | bb_simple_perror_msg_and_die(fname); |
338 | } | 338 | } |
339 | dumper->address += dumper->pub.dump_skip; | 339 | dumper->address += dumper->pub.dump_skip; |
diff --git a/util-linux/hexdump.c b/util-linux/hexdump.c index 9a312f95c..43fc188bf 100644 --- a/util-linux/hexdump.c +++ b/util-linux/hexdump.c | |||
@@ -116,7 +116,12 @@ int hexdump_main(int argc, char **argv) | |||
116 | dumper->dump_length = xatoi_positive(optarg); | 116 | dumper->dump_length = xatoi_positive(optarg); |
117 | } /* else */ | 117 | } /* else */ |
118 | if (ch == 's') { /* compat: -s accepts hex numbers too */ | 118 | if (ch == 's') { /* compat: -s accepts hex numbers too */ |
119 | dumper->dump_skip = xstrtoul_range_sfx(optarg, /*base:*/ 0, /*lo:*/ 0, /*hi:*/ LONG_MAX, suffixes); | 119 | dumper->dump_skip = xstrtoul_range_sfx( |
120 | optarg, | ||
121 | /*base:*/ 0, | ||
122 | /*lo:*/ 0, /*hi:*/ OFF_T_MAX, | ||
123 | suffixes | ||
124 | ); | ||
120 | } /* else */ | 125 | } /* else */ |
121 | if (ch == 'v') { | 126 | if (ch == 'v') { |
122 | dumper->dump_vflag = ALL; | 127 | dumper->dump_vflag = ALL; |