mirror of
https://github.com/RPCS3/hidapi.git
synced 2026-07-21 00:45:21 -04:00
Fix warning: comparison of unsigned expression < 0 is always false
iconv() returns a size_t so is always a positive value. In case of error the returned value is (size_t)-1 so compare with this specific value instead of < 0 Signed-off-by: Alan Ott <alan@signal11.us>
This commit is contained in:
committed by
Alan Ott
parent
8c80bbd8b7
commit
218d146c37
+1
-1
@@ -216,7 +216,7 @@ static wchar_t *get_usb_string(libusb_device_handle *dev, uint8_t idx)
|
||||
outptr = (char*) wbuf;
|
||||
outbytes = sizeof(wbuf);
|
||||
res = iconv(ic, &inptr, &inbytes, &outptr, &outbytes);
|
||||
if (res < 0)
|
||||
if (res == (size_t)-1)
|
||||
goto err;
|
||||
|
||||
/* Write the terminating NULL. */
|
||||
|
||||
Reference in New Issue
Block a user