Author: kevlo
Date: Sun Feb 14 14:23:56 2016
New Revision: 295610
URL: https://svnweb.freebsd.org/changeset/base/295610

Log:
  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

Modified:
  head/usr.bin/hexdump/display.c

Modified: head/usr.bin/hexdump/display.c
==============================================================================
--- head/usr.bin/hexdump/display.c      Sun Feb 14 13:42:16 2016        
(r295609)
+++ head/usr.bin/hexdump/display.c      Sun Feb 14 14:23:56 2016        
(r295610)
@@ -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;
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to