From bcaa2718930fab04c87b880bfcec144f51ec7ed4 Mon Sep 17 00:00:00 2001 From: slaren Date: Wed, 4 Sep 2024 17:03:33 +0200 Subject: [PATCH] llama-bench : fix NUL terminators in CPU name --- examples/llama-bench/llama-bench.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/llama-bench/llama-bench.cpp b/examples/llama-bench/llama-bench.cpp index bf97cc684ddf5..0c9bcb777a268 100644 --- a/examples/llama-bench/llama-bench.cpp +++ b/examples/llama-bench/llama-bench.cpp @@ -124,6 +124,9 @@ static std::string get_cpu_info() { (LPBYTE)cpu_brand, &cpu_brand_size) == ERROR_SUCCESS) { id.assign(cpu_brand, cpu_brand_size); + if (id.find('\0') != std::string::npos) { + id.resize(id.find('\0')); + } } RegCloseKey(hKey); #endif