8264684: os::get_summary_cpu_info padded with spaces

Reviewed-by: iklam, ccheung
This commit is contained in:
Afshin Zafari 2023-01-12 01:54:11 +00:00 committed by Ioi Lam
parent 78b1686c15
commit af8d3fb21a

View File

@ -1888,6 +1888,10 @@ void os::get_summary_cpu_info(char* buf, size_t buflen) {
status = RegQueryValueEx(key, "ProcessorNameString", NULL, NULL, (byte*)buf, &size);
if (status != ERROR_SUCCESS) {
strncpy(buf, "## __CPU__", buflen);
} else {
if (size < buflen) {
buf[size] = '\0';
}
}
RegCloseKey(key);
} else {