Fix 'strncpy' truncating warnings when compiling with gcc 8

Change-Id: Ib145bab9450281da05f70dea34433b83438a756b
Signed-off-by: Slava Grigorev <slava.grigorev@amd.com>
This commit is contained in:
Slava Grigorev
2018-06-29 16:06:45 -04:00
committad av Felix Kuehling
förälder 4eaaf9694d
incheckning 89e35574e3
+1 -1
Visa fil
@@ -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];