Fix cppcheck warning "buffer may not be null-terminated after call to strncpy()"
This commit is contained in:
parent
3e773ab494
commit
1d5f9956fb
5 changed files with 5 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue