[git commit] hexdump: don't unconditionally limit the usable address range

Denys Vlasenko vda.linux at googlemail.com
Wed Mar 27 14:15:33 UTC 2013


commit: http://git.busybox.net/busybox/commit/?id=ef6747e290d0456d140129f28283e0761713da2e
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 libbb/dump.c         |    2 +-
 util-linux/hexdump.c |    7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/libbb/dump.c b/libbb/dump.c
index 7e43564..566881a 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)
 			return;
 		}
 	}
-	if (fseek(stdin, dumper->pub.dump_skip, SEEK_SET)) {
+	if (fseeko(stdin, dumper->pub.dump_skip, SEEK_SET)) {
 		bb_simple_perror_msg_and_die(fname);
 	}
 	dumper->address += dumper->pub.dump_skip;
diff --git a/util-linux/hexdump.c b/util-linux/hexdump.c
index 9a312f9..43fc188 100644
--- a/util-linux/hexdump.c
+++ b/util-linux/hexdump.c
@@ -116,7 +116,12 @@ int hexdump_main(int argc, char **argv)
 			dumper->dump_length = xatoi_positive(optarg);
 		} /* else */
 		if (ch == 's') { /* compat: -s accepts hex numbers too */
-			dumper->dump_skip = xstrtoul_range_sfx(optarg, /*base:*/ 0, /*lo:*/ 0, /*hi:*/ LONG_MAX, suffixes);
+			dumper->dump_skip = xstrtoul_range_sfx(
+				optarg,
+				/*base:*/ 0,
+				/*lo:*/ 0, /*hi:*/ OFF_T_MAX,
+				suffixes
+			);
 		} /* else */
 		if (ch == 'v') {
 			dumper->dump_vflag = ALL;


More information about the busybox-cvs mailing list