]> sigrok.org Git - libserialport.git/blobdiff - windows.c
windows: Fix a warning on size_t to USHORT conversion.
[libserialport.git] / windows.c
index bc07e234c341ebf8cdec4d34aa1344ae2fe4429a..f9c2c41faf768925e6eb38b0a1784150f283cc6c 100644 (file)
--- a/windows.c
+++ b/windows.c
@@ -143,7 +143,7 @@ static char *get_string_descriptor(HANDLE hub_device, ULONG connection_index,
        desc_req->SetupPacket.wValue = (USB_STRING_DESCRIPTOR_TYPE << 8)
                                       | descriptor_index;
        desc_req->SetupPacket.wIndex = 0;
-       desc_req->SetupPacket.wLength = size - sizeof(*desc_req);
+       desc_req->SetupPacket.wLength = (USHORT) (size - sizeof(*desc_req));
 
        if (!DeviceIoControl(hub_device,
                             IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION,