diff options
author | 2016-02-08 22:09:22 +0000 | |
---|---|---|
committer | 2016-02-08 22:09:22 +0000 | |
commit | 9ddc59ea1510973ddfd400c1c3287e2d1202bba7 (patch) | |
tree | aca9b3ea235c1398324a9c7f8feab46e2b6df212 | |
parent | remove main() declaration (diff) | |
download | wireguard-openbsd-9ddc59ea1510973ddfd400c1c3287e2d1202bba7.tar.xz wireguard-openbsd-9ddc59ea1510973ddfd400c1c3287e2d1202bba7.zip |
Fix a bug that caused nothing to be skipped when skipping exactly the
number of bytes present in a regular file was requested.
Bug reported by a user called "tdm" on the comstyle #openbsd IRC channel.
Patch written by Michal Mazurek <akfaew at jasminek dot net>.
OK jung@ millert@ czarkoff@
-rw-r--r-- | usr.bin/hexdump/display.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/hexdump/display.c b/usr.bin/hexdump/display.c index db9506765c1..2c755d61173 100644 --- a/usr.bin/hexdump/display.c +++ b/usr.bin/hexdump/display.c @@ -1,4 +1,4 @@ -/* $OpenBSD: display.c,v 1.21 2015/01/16 06:40:08 deraadt Exp $ */ +/* $OpenBSD: display.c,v 1.22 2016/02/08 22:09:22 schwarze Exp $ */ /* $NetBSD: display.c,v 1.12 2001/12/07 15:14:29 bjh21 Exp $ */ /* @@ -329,7 +329,7 @@ doskip(const char *fname, int statok) if (fstat(fileno(stdin), &sb)) err(1, "fstat %s", fname); if (S_ISREG(sb.st_mode)) { - if (skip >= sb.st_size) { + if (skip > sb.st_size) { address += sb.st_size; skip -= sb.st_size; } else { |