mirror of
https://github.com/RPCS3/hidapi.git
synced 2024-12-13 21:58:46 +00:00
Linux/hidraw: Fix return value string functions
get_serial_number() get_manufacturer_string() get_product_string() This matches the documentation in header file to return 0 on success and -1 on error.
This commit is contained in:
parent
7f6b496374
commit
8717b87398
@ -186,7 +186,7 @@ static int get_device_string(hid_device *dev, const char *key, wchar_t *string,
|
||||
str = udev_device_get_sysattr_value(parent, key);
|
||||
if (str) {
|
||||
/* Convert the string from UTF-8 to wchar_t */
|
||||
ret = mbstowcs(string, str, maxlen);
|
||||
ret = (mbstowcs(string, str, maxlen) < 0)? -1: 0;
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user