hexdump: don't unconditionally limit the usable address range
authorDenys Vlasenko <vda.linux@googlemail.com>
Wed, 27 Mar 2013 14:15:33 +0000 (15:15 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Wed, 27 Mar 2013 14:15:33 +0000 (15:15 +0100)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
libbb/dump.c
util-linux/hexdump.c

index 7e435643bdeb57b8fa376fd511a354d6675a4df3..566881a781fd9356a4bd851b0bfa4d337e615512 100644 (file)
@@ -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;
index 9a312f95c64b2e6d6b56b9850749859087db3f00..43fc188bf1abfec32cbc0b0fd9e7b863814c2bf3 100644 (file)
@@ -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;