mirror of
https://github.com/RPCS3/hidapi.git
synced 2025-02-12 13:48:14 +00:00
windows: replace magic number 2 with sizeof(wchar_t)
Changed for readability, as I think this is what was intended by the author.
This commit is contained in:
parent
c6f2900275
commit
0ed94093c8
@ -794,7 +794,7 @@ int HID_API_EXPORT_CALL HID_API_CALL hid_get_manufacturer_string(hid_device *dev
|
|||||||
{
|
{
|
||||||
BOOL res;
|
BOOL res;
|
||||||
|
|
||||||
res = HidD_GetManufacturerString(dev->device_handle, string, 2 * maxlen);
|
res = HidD_GetManufacturerString(dev->device_handle, string, sizeof(wchar_t) * maxlen);
|
||||||
if (!res) {
|
if (!res) {
|
||||||
register_error(dev, "HidD_GetManufacturerString");
|
register_error(dev, "HidD_GetManufacturerString");
|
||||||
return -1;
|
return -1;
|
||||||
@ -807,7 +807,7 @@ int HID_API_EXPORT_CALL HID_API_CALL hid_get_product_string(hid_device *dev, wch
|
|||||||
{
|
{
|
||||||
BOOL res;
|
BOOL res;
|
||||||
|
|
||||||
res = HidD_GetProductString(dev->device_handle, string, 2 * maxlen);
|
res = HidD_GetProductString(dev->device_handle, string, sizeof(wchar_t) * maxlen);
|
||||||
if (!res) {
|
if (!res) {
|
||||||
register_error(dev, "HidD_GetProductString");
|
register_error(dev, "HidD_GetProductString");
|
||||||
return -1;
|
return -1;
|
||||||
@ -820,7 +820,7 @@ int HID_API_EXPORT_CALL HID_API_CALL hid_get_serial_number_string(hid_device *de
|
|||||||
{
|
{
|
||||||
BOOL res;
|
BOOL res;
|
||||||
|
|
||||||
res = HidD_GetSerialNumberString(dev->device_handle, string, 2 * maxlen);
|
res = HidD_GetSerialNumberString(dev->device_handle, string, sizeof(wchar_t) * maxlen);
|
||||||
if (!res) {
|
if (!res) {
|
||||||
register_error(dev, "HidD_GetSerialNumberString");
|
register_error(dev, "HidD_GetSerialNumberString");
|
||||||
return -1;
|
return -1;
|
||||||
@ -833,7 +833,7 @@ int HID_API_EXPORT_CALL HID_API_CALL hid_get_indexed_string(hid_device *dev, int
|
|||||||
{
|
{
|
||||||
BOOL res;
|
BOOL res;
|
||||||
|
|
||||||
res = HidD_GetIndexedString(dev->device_handle, string_index, string, 2 * maxlen);
|
res = HidD_GetIndexedString(dev->device_handle, string_index, string, sizeof(wchar_t) * maxlen);
|
||||||
if (!res) {
|
if (!res) {
|
||||||
register_error(dev, "HidD_GetIndexedString");
|
register_error(dev, "HidD_GetIndexedString");
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user