diff options
author | Patrick Griffis <tingping@tingping.se> | 2018-09-01 16:32:37 -0400 |
---|---|---|
committer | Patrick Griffis <tingping@tingping.se> | 2018-09-01 16:35:48 -0400 |
commit | 18eae24acfedce4b5eab761edf23748642004ae3 (patch) | |
tree | 14bfe4ba677d993ff60c3df8aff6107201987a78 /plugins/sysinfo/unix/pci.c | |
parent | c092af89a24d05b1d02858f3d84c38292e2347b5 (diff) |
Fix new stringop-truncation warnings
Diffstat (limited to 'plugins/sysinfo/unix/pci.c')
-rw-r--r-- | plugins/sysinfo/unix/pci.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/sysinfo/unix/pci.c b/plugins/sysinfo/unix/pci.c index 10addf6f..528afd97 100644 --- a/plugins/sysinfo/unix/pci.c +++ b/plugins/sysinfo/unix/pci.c @@ -142,7 +142,7 @@ void pci_find_fullname(char *fullname, char *vendor, char *device) { position = strstr(buffer, vendor); position += 6; - strncpy(vendorname, position, bsize/2); + g_strlcpy(vendorname, position, sizeof (vendorname)); position = strstr(vendorname, "\n"); *(position) = '\0'; break; @@ -154,7 +154,7 @@ void pci_find_fullname(char *fullname, char *vendor, char *device) { position = strstr(buffer, device); position += 6; - strncpy(devicename, position, bsize/2); + g_strlcpy(devicename, position, sizeof (devicename)); position = strstr(devicename, " ("); if (position == NULL) position = strstr(devicename, "\n"); |