From 18eae24acfedce4b5eab761edf23748642004ae3 Mon Sep 17 00:00:00 2001 From: Patrick Griffis Date: Sat, 1 Sep 2018 16:32:37 -0400 Subject: Fix new stringop-truncation warnings --- plugins/sysinfo/unix/pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins/sysinfo') 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"); -- cgit 1.4.1