From 9de31fc5ceb82f069f7851ea983c36f6fdbf1634 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Sun, 16 Sep 2018 12:46:40 +0300 Subject: [PATCH] Fix trailing zeros in CPU brand --- Utilities/sysinfo.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Utilities/sysinfo.cpp b/Utilities/sysinfo.cpp index cfe2c06d22..b651704bb8 100644 --- a/Utilities/sysinfo.cpp +++ b/Utilities/sysinfo.cpp @@ -73,8 +73,9 @@ std::string utils::get_system_info() brand = "Unknown CPU"; } - brand.erase(0, brand.find_first_not_of(' ')); + brand.erase(brand.find_last_not_of('\0') + 1); brand.erase(brand.find_last_not_of(' ') + 1); + brand.erase(0, brand.find_first_not_of(' ')); while (auto found = brand.find(" ") + 1) {