mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-10-17 22:10:54 +00:00
Fixed 0 value of paranoid handling
This commit is contained in:
parent
1edd29b3f8
commit
901f546aee
@ -210,12 +210,7 @@ static bool getPerfEventParanoid(Int32 & result)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
str[max_length - 1] = '\0';
|
str[max_length - 1] = '\0';
|
||||||
Int64 value = strtol(str, nullptr, 10);
|
result = atoi(str);
|
||||||
// the only way to be incorrect is to not be a number
|
|
||||||
if (value == 0 && errno != 0)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
result = static_cast<Int32>(value);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user