diff --git a/src/topology.c b/src/topology.c index 32fa642b1d..86b812e021 100644 --- a/src/topology.c +++ b/src/topology.c @@ -669,7 +669,7 @@ static HSAKMT_STATUS topology_get_cpu_model_name(HsaNodeProperties *props, if (props->CComputeIdLo == apic_id) { /* Retrieve the CAL name of CPU node */ if (!is_apu) - strncpy((char *)props->AMDName, cpu_model_name, sizeof(props->AMDName)-1); + strncpy((char *)props->AMDName, cpu_model_name, sizeof(props->AMDName)); /* Convert from UTF8 to UTF16 */ for (i = 0; cpu_model_name[i] != '\0' && i < HSA_PUBLIC_NAME_SIZE - 1; i++) props->MarketingName[i] = cpu_model_name[i];