Fixed 0 value of paranoid handling

This commit is contained in:
Andrey Skobtsov 2020-05-19 00:40:15 +03:00
parent 1edd29b3f8
commit 901f546aee

View File

@ -210,12 +210,7 @@ static bool getPerfEventParanoid(Int32 & result)
return false;
str[max_length - 1] = '\0';
Int64 value = strtol(str, nullptr, 10);
// the only way to be incorrect is to not be a number
if (value == 0 && errno != 0)
return false;
result = static_cast<Int32>(value);
result = atoi(str);
return true;
}