Thread (2 messages) 2 messages, 2 authors, 2021-06-29

Re: [PATCH] mpi3mr: Fix W=1 compilation warnings

From: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Date: 2021-06-29 14:08:40

On Tue, Jun 29, 2021 at 9:14 AM Martin K. Petersen
[off-list ref] wrote:

Sreekanth,
quoted
-     strncpy(drv_info->os_name, utsname()->sysname, sizeof(drv_info->os_name));
-     drv_info->os_name[sizeof(drv_info->os_name) - 1] = 0;
-     strncpy(drv_info->os_version, utsname()->release, sizeof(drv_info->os_version));
-     drv_info->os_version[sizeof(drv_info->os_version) - 1] = 0;
+     memcpy(drv_info->os_name, utsname()->sysname, sizeof(drv_info->os_name) - 1);
+     memcpy(drv_info->os_version, utsname()->release, sizeof(drv_info->os_version) - 1);
strscpy()?
Agreed. Posted a new patch using strscpy().

Thanks,
Sreekanth
--
Martin K. Petersen      Oracle Linux Engineering

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help