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:
Ludovic Rousseau
2010-10-08 15:59:49 +02:00
committed by Alan Ott
parent 8c80bbd8b7
commit 218d146c37
+1 -1
View File
@@ -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. */