Fix compiler warning for pieusb backend
The debian-10-mini
build issues the following warnings:
CC libpieusb_la-pieusb_specific.lo
CC libpieusb_la-pieusb_usb.lo
In function 'pieusb_initialize_device_definition',
inlined from 'sanei_pieusb_find_device_callback' at pieusb_specific.c:280:9:
pieusb_specific.c:325:5: warning: 'strncpy' output may be truncated copying 8 bytes from a string of length 8 [-Wstringop-truncation]
strncpy(buf, inq->vendor, 8);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
pieusb_specific.c:335:5: warning: 'strncpy' output may be truncated copying 16 bytes from a string of length 16 [-Wstringop-truncation]
strncpy(buf, inq->product, 16);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pieusb_specific.c:349:5: warning: 'strncpy' output may be truncated copying 4 bytes from a string of length 4 [-Wstringop-truncation]
strncpy(buf, inq->productRevision, 4);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This should be fixed. At first sight, it looks like these should be memcpy
s instead.
See also #120 (closed)