Signed-off-by: Theodore Ts'o <tytso@mit.edu>
_INLINE_ errcode_t ext2fs_get_array(unsigned long count, 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);
}
return EXT2_ET_NO_MEMORY;
return ext2fs_get_mem(count*size, ptr);
}
- if (count && (-1UL)/count<size)
+ if (count && (~0UL)/count < size)
return EXT2_ET_NO_MEMORY;
pp = calloc(count, size);
if (!pp)
return EXT2_ET_NO_MEMORY;
pp = calloc(count, size);
if (!pp)