]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
test_sparse_basic: avoid always-true comparsion
authorMartin Matuska <martin@matuska.de>
Thu, 8 Dec 2022 15:27:00 +0000 (16:27 +0100)
committerMartin Matuska <martin@matuska.de>
Thu, 8 Dec 2022 15:27:00 +0000 (16:27 +0100)
Reported by: CodeQL
Code Scanning Alert: 126

libarchive/test/test_sparse_basic.c

index 133a853985474fa9340fec025f974d29dc557073..484c2865617259814e4f772c9893eea9012d7c1f 100644 (file)
@@ -253,8 +253,10 @@ is_sparse_supported(const char *path)
 #if defined(HAVE_LINUX_FIEMAP_H)
        if (r < 0)
                return (is_sparse_supported_fiemap(path));
-#endif
+       return (1);
+#else
        return (r >= 0);
+#endif
 }
 
 #elif !defined(HAVE_LINUX_FIEMAP_H)