diff options
author | Martin Matuska <martin@matuska.de> | 2022-12-08 16:27:00 +0100 |
---|---|---|
committer | Martin Matuska <martin@matuska.de> | 2022-12-08 16:27:00 +0100 |
commit | 09b2d329bf58ecec06b476ad2510428c73186e99 (patch) | |
tree | 6406fec0ff6c12f2b985f6fd7354f917e90786eb | |
parent | 0eac3985f068dfda69840264090a5b0f26def3fd (diff) | |
download | libarchive-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.c | 4 |
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) |