From 09b2d329bf58ecec06b476ad2510428c73186e99 Mon Sep 17 00:00:00 2001 From: Martin Matuska Date: Thu, 8 Dec 2022 16:27:00 +0100 Subject: test_sparse_basic: avoid always-true comparsion Reported by: CodeQL Code Scanning Alert: 126 --- libarchive/test/test_sparse_basic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) -- cgit v1.2.1