]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Don't report a negative error code as a count of available bytes.
authorTim Kientzle <kientzle@gmail.com>
Fri, 4 Sep 2009 04:21:50 +0000 (00:21 -0400)
committerTim Kientzle <kientzle@gmail.com>
Fri, 4 Sep 2009 04:21:50 +0000 (00:21 -0400)
In this case, any error means there are zero bytes available.

SVN-Revision: 1420

libarchive/archive_read.c

index f1c625d31d37233276bae99ce2c2988d49b521e4..c72e27d02cf97cc7c6552de9ccbab2ab1f2c65f7 100644 (file)
@@ -1150,6 +1150,8 @@ __archive_read_skip(struct archive_read *a, int64_t request)
        if (skipped == request)
                return (skipped);
        /* We hit EOF before we satisfied the skip request. */
+       if (skipped < 0)  // Map error code to 0 for error message below.
+               skipped = 0;
        archive_set_error(&a->archive,
            ARCHIVE_ERRNO_MISC,
            "Truncated input file (needed %jd bytes, only %jd available)",