From 424eac8b6aa15887c4c723504404a2079bc8c026 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Tue, 24 Dec 2019 12:07:47 +0100 Subject: [PATCH] usb: Use OSMO_STRLCPY where appropriate Change-Id: I6b2a90fd8f4b042a1e38dbf8e99414a94a290375 --- src/usb/osmo_libusb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/usb/osmo_libusb.c b/src/usb/osmo_libusb.c index 5b012b865..b10f5bebd 100644 --- a/src/usb/osmo_libusb.c +++ b/src/usb/osmo_libusb.c @@ -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].product = dev_desc.idProduct; 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].configuration = conf_desc->bConfigurationValue; out[out_idx].interface = if_desc->bInterfaceNumber;