debugger: fix warning format-overflow= '%s' directive arg is null

Change-Id: Iba00fbcc3f8fde088bed62b93c4e3acae4e0b902
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4777
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
This commit is contained in:
Alexander von Gluck IV 2021-12-12 09:19:37 -06:00 committed by Jérôme Duval
parent 4c8e85b316
commit 000310809f

View File

@ -290,9 +290,12 @@ DebugReportGenerator::_GenerateReportHeader(BFile& _output)
SystemInfo sysInfo;
if (fDebuggerInterface->GetSystemInfo(sysInfo) == B_OK) {
const system_info &info = sysInfo.GetSystemInfo();
const char* vendor = get_cpu_vendor_string(cpuVendor);
const char* model = get_cpu_model_string(platform, cpuVendor, cpuModel);
data.SetToFormat("CPU(s): %" B_PRId32 "x %s %s\n",
info.cpu_count, get_cpu_vendor_string(cpuVendor),
get_cpu_model_string(platform, cpuVendor, cpuModel));
info.cpu_count, vendor != NULL ? vendor : "unknown",
model != NULL ? model : "unknown");
WRITE_AND_CHECK(_output, data);
char maxSize[32];