mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-04-11 09:06:17 +00:00
Fix cppcheck warning "buffer may not be null-terminated after call to strncpy()"
This commit is contained in:
@@ -295,6 +295,7 @@ pn53x_usb_get_usb_device_name(struct usb_device *dev, usb_dev_handle *udev, char
|
||||
if ((pn53x_usb_supported_devices[n].vendor_id == dev->descriptor.idVendor) &&
|
||||
(pn53x_usb_supported_devices[n].product_id == dev->descriptor.idProduct)) {
|
||||
strncpy(buffer, pn53x_usb_supported_devices[n].name, len);
|
||||
buffer[len - 1] = '\0';
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user