Fix cppcheck warning "buffer may not be null-terminated after call to strncpy()"

This commit is contained in:
Philippe Teuwen 2013-03-06 12:38:59 +01:00
parent 3e773ab494
commit 1d5f9956fb
5 changed files with 5 additions and 0 deletions

View file

@ -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;
}
}