]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
libext2fs: use ~0UL instead of -1UL to avoid static checker warnings
authorTheodore Ts'o <tytso@mit.edu>
Sun, 21 Sep 2014 19:36:57 +0000 (15:36 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 21 Sep 2014 19:36:57 +0000 (15:36 -0400)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/ext2fs.h

index d931fff980247a90339fbfe2a709c6491fbc80f2..fef691001eb38370f675fcd92287c6fc4c984c5a 100644 (file)
@@ -1712,7 +1712,7 @@ _INLINE_ errcode_t ext2fs_get_memzero(unsigned long size, void *ptr)
 
 _INLINE_ errcode_t ext2fs_get_array(unsigned long count, unsigned long size, void *ptr)
 {
-       if (count && (-1UL)/count<size)
+       if (count && (~0UL)/count < size)
                return EXT2_ET_NO_MEMORY;
        return ext2fs_get_mem(count*size, ptr);
 }
@@ -1722,7 +1722,7 @@ _INLINE_ errcode_t ext2fs_get_arrayzero(unsigned long count,
 {
        void *pp;
 
-       if (count && (-1UL)/count<size)
+       if (count && (~0UL)/count < size)
                return EXT2_ET_NO_MEMORY;
        pp = calloc(count, size);
        if (!pp)