]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Correct assignment to r when checking for result of reading archive data (#1929)
authorAtariDreams <83477269+AtariDreams@users.noreply.github.com>
Sun, 23 Jul 2023 22:10:10 +0000 (18:10 -0400)
committerGitHub <noreply@github.com>
Sun, 23 Jul 2023 22:10:10 +0000 (00:10 +0200)
It is impossible for if (r == ARCHIVE_FATAL) to be true otherwise.

contrib/archivetest.c

index e4a25e3c911dc1dfe2e69f87aaf96f449f3b1765..a298f565439a90c91c044ce9a9cbdf02b80cb3bc 100644 (file)
@@ -200,7 +200,7 @@ int main(int argc, char *argv[])
                if (skip_data) {
                        v_print(v, "skipping");
                } else {
-                       while ((r = archive_read_data(a, buffer, 4096) > 0))
+                       while ((r = archive_read_data(a, buffer, 4096)) > 0)
                        ;
                        if (r == ARCHIVE_FATAL) {
                                v_print(v, "ERROR\nError string: %s\n",