Skip to content

Commit

Permalink
llama-bench : fix NUL terminators in CPU name (ggerganov#9313)
Browse files Browse the repository at this point in the history
  • Loading branch information
slaren authored and dsx1986 committed Oct 29, 2024
1 parent cac8909 commit f230651
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 f230651

Please sign in to comment.