summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorkevlo <kevlo@FreeBSD.org>2016-02-14 14:23:56 +0000
committerkevlo <kevlo@FreeBSD.org>2016-02-14 14:23:56 +0000
commitd4f3e58ebfa3109da83658aa07dfb663ed4b6a72 (patch)
tree99308e0346c3f4fd9335b942bb9e2be611208f8c /usr.bin
parentbc9b18cea2385ac27eaffb6d0bcc79725b4949e8 (diff)
downloadFreeBSD-src-d4f3e58ebfa3109da83658aa07dfb663ed4b6a72.zip
FreeBSD-src-d4f3e58ebfa3109da83658aa07dfb663ed4b6a72.tar.gz
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
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/hexdump/display.c2
1 files changed, 1 insertions, 1 deletions
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;
OpenPOWER on IntegriCloud