summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Matuska <martin@matuska.de>2022-12-08 16:27:00 +0100
committerMartin Matuska <martin@matuska.de>2022-12-08 16:27:00 +0100
commit09b2d329bf58ecec06b476ad2510428c73186e99 (patch)
tree6406fec0ff6c12f2b985f6fd7354f917e90786eb
parent0eac3985f068dfda69840264090a5b0f26def3fd (diff)
downloadlibarchive-09b2d329bf58ecec06b476ad2510428c73186e99.tar.gz
test_sparse_basic: avoid always-true comparsion
Reported by: CodeQL Code Scanning Alert: 126
-rw-r--r--libarchive/test/test_sparse_basic.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libarchive/test/test_sparse_basic.c b/libarchive/test/test_sparse_basic.c
index 133a8539..484c2865 100644
--- a/libarchive/test/test_sparse_basic.c
+++ b/libarchive/test/test_sparse_basic.c
@@ -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)