From d4f3e58ebfa3109da83658aa07dfb663ed4b6a72 Mon Sep 17 00:00:00 2001 From: kevlo Date: Sun, 14 Feb 2016 14:23:56 +0000 Subject: Fix a bug that caused nothing to be skipped when skipping exactly the number of bytes present in a regular file was requested. Obtained from: OpenBSD --- usr.bin/hexdump/display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'usr.bin') diff --git a/usr.bin/hexdump/display.c b/usr.bin/hexdump/display.c index 4ff3308..36230aa 100644 --- a/usr.bin/hexdump/display.c +++ b/usr.bin/hexdump/display.c @@ -374,7 +374,7 @@ doskip(const char *fname, int statok) if (statok) { if (fstat(fileno(stdin), &sb)) err(1, "%s", fname); - if (S_ISREG(sb.st_mode) && skip >= sb.st_size) { + if (S_ISREG(sb.st_mode) && skip > sb.st_size) { address += sb.st_size; skip -= sb.st_size; return; -- cgit v1.1