llama-bench : fix NUL terminators in CPU name

This commit is contained in:
slaren 2024-09-04 17:03:33 +02:00
parent c8671ae282
commit bcaa271893

View file

@ -124,6 +124,9 @@ static std::string get_cpu_info() {
(LPBYTE)cpu_brand, (LPBYTE)cpu_brand,
&cpu_brand_size) == ERROR_SUCCESS) { &cpu_brand_size) == ERROR_SUCCESS) {
id.assign(cpu_brand, cpu_brand_size); id.assign(cpu_brand, cpu_brand_size);
if (id.find('\0') != std::string::npos) {
id.resize(id.find('\0'));
}
} }
RegCloseKey(hKey); RegCloseKey(hKey);
#endif #endif