usb: Use OSMO_STRLCPY where appropriate

Change-Id: I6b2a90fd8f4b042a1e38dbf8e99414a94a290375
This commit is contained in:
Harald Welte 2019-12-24 12:07:47 +01:00
parent 57d1118c25
commit 424eac8b6a
1 changed files with 1 additions and 1 deletions

View File

@ -276,7 +276,7 @@ int osmo_libusb_dev_find_matching_interfaces(libusb_device *dev, int class, int
out[out_idx].vendor = dev_desc.idVendor; out[out_idx].vendor = dev_desc.idVendor;
out[out_idx].product = dev_desc.idProduct; out[out_idx].product = dev_desc.idProduct;
out[out_idx].addr = addr; out[out_idx].addr = addr;
strncpy(out[out_idx].path, path, sizeof(out[out_idx].path)-1); OSMO_STRLCPY_ARRAY(out[out_idx].path, path);
out[out_idx].path[sizeof(out[out_idx].path)-1] = '\0'; out[out_idx].path[sizeof(out[out_idx].path)-1] = '\0';
out[out_idx].configuration = conf_desc->bConfigurationValue; out[out_idx].configuration = conf_desc->bConfigurationValue;
out[out_idx].interface = if_desc->bInterfaceNumber; out[out_idx].interface = if_desc->bInterfaceNumber;