summaryrefslogtreecommitdiff
path: root/usr.bin/hexdump
diff options
context:
space:
mode:
authorKevin Lo <kevlo@FreeBSD.org>2016-02-14 14:23:56 +0000
committerKevin Lo <kevlo@FreeBSD.org>2016-02-14 14:23:56 +0000
commitdaa1a379ce523f7180e9570da56ad151729714a0 (patch)
tree99308e0346c3f4fd9335b942bb9e2be611208f8c /usr.bin/hexdump
parentbcccdfa37bad4ddb6b564ec9d17908c0a8ffa321 (diff)
downloadsrc-test2-daa1a379ce523f7180e9570da56ad151729714a0.tar.gz
src-test2-daa1a379ce523f7180e9570da56ad151729714a0.zip
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
Notes
Notes: svn path=/head/; revision=295610
Diffstat (limited to 'usr.bin/hexdump')
-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 4ff33080780b..36230aa7da58 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;