]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
llama-bench : fix NUL terminators in CPU name (#9313)
authorslaren <redacted>
Thu, 5 Sep 2024 00:19:39 +0000 (02:19 +0200)
committerGitHub <redacted>
Thu, 5 Sep 2024 00:19:39 +0000 (02:19 +0200)
examples/llama-bench/llama-bench.cpp

index bf97cc684ddf58bdaaa7e4c4085ee3410700878e..0c9bcb777a268fb03e820d09d508e9059e40f872 100644 (file)
@@ -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