From: Martin Matuska Date: Thu, 8 Dec 2022 15:27:00 +0000 (+0100) Subject: test_sparse_basic: avoid always-true comparsion X-Git-Tag: v3.6.2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=09b2d329bf58ecec06b476ad2510428c73186e99;p=thirdparty%2Flibarchive.git test_sparse_basic: avoid always-true comparsion Reported by: CodeQL Code Scanning Alert: 126 --- diff --git a/libarchive/test/test_sparse_basic.c b/libarchive/test/test_sparse_basic.c index 133a85398..484c28656 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)