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:
Vadim Zaliva 2011-05-03 06:07:55 +08:00 committed by Alan Ott
parent 7f6b496374
commit 8717b87398

View File

@ -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;
}
}