1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-18 10:04:20 +03:00

dmstats: check for zero in _nr_areas_from_step() (Coverity)

This commit is contained in:
Bryn M. Reeves 2015-08-17 18:31:11 +01:00
parent b01e9651b0
commit 69fa16048a

View File

@ -4434,6 +4434,10 @@ static int _size_from_string(char *argptr, uint64_t *size, const char *name)
*/
static uint64_t _nr_areas_from_step(uint64_t len, int64_t step)
{
/* Default is one area. */
if (!step || !len)
return 1;
/* --areas */
if (step < 0)
return (uint64_t)(-step);