Fix new stringop-truncation warnings

This commit is contained in:
Patrick Griffis
2018-09-01 16:32:37 -04:00
parent c092af89a2
commit 18eae24acf
3 changed files with 4 additions and 4 deletions

View File

@@ -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");