Negating size_t on 32bit produces a 32bit result. This was effectively
adding values close to UINT_MAX to the cache size (the files are usually
small) instead of intended subtraction.
Fixes 'make check' disk_cache failures on 32bit.
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
free(dir_path);
if (size) {
- p_atomic_add(cache->size, - size);
+ p_atomic_add(cache->size, - (uint64_t)size);
return;
}
free(dir_path);
if (size)
- p_atomic_add(cache->size, - size);
+ p_atomic_add(cache->size, - (uint64_t)size);
}
void
free(filename);
if (sb.st_size)
- p_atomic_add(cache->size, - sb.st_size);
+ p_atomic_add(cache->size, - (uint64_t)sb.st_size);
}
/* From the zlib docs: