Skip to content

Commit

Permalink
llama-bench : fix NUL terminators in CPU name (#9313)
Browse files Browse the repository at this point in the history
  • Loading branch information
slaren authored Sep 5, 2024
1 parent 581c305 commit bdf314f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/llama-bench/llama-bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bdf314f

Please sign in to comment.