From 901f546aee449c57e3c7b0e15e0213c751dc7d5f Mon Sep 17 00:00:00 2001 From: Andrey Skobtsov Date: Tue, 19 May 2020 00:40:15 +0300 Subject: [PATCH] Fixed 0 value of paranoid handling --- src/Common/ThreadProfileEvents.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/Common/ThreadProfileEvents.cpp b/src/Common/ThreadProfileEvents.cpp index 4effd6231d4..d8648b81362 100644 --- a/src/Common/ThreadProfileEvents.cpp +++ b/src/Common/ThreadProfileEvents.cpp @@ -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(value); + result = atoi(str); return true; }