Skip to content

Commit 470c9e9

Browse files
author
Stephen
committed
Don't assign -1 to size_t. That's silly
1 parent 3710895 commit 470c9e9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libusb/hid.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ static int get_usage(uint8_t *report_descriptor, size_t size,
286286
}
287287

288288
/* Retrieves the largest report size (in bytes) from the passed in report descriptor.
289-
The return value is the size on success and -1 on failure. */
289+
The return value is the size on success and 0 on failure. */
290290
static size_t get_max_report_size(uint8_t * report_descriptor, int desc_size, enum report_descr_type report_type)
291291
{
292292
int i = 0;
@@ -1314,7 +1314,7 @@ static int hidapi_initialize_device(hid_device *dev, const struct libusb_interfa
13141314
if (desc_size > 0) {
13151315
dev->max_input_report_size = get_max_report_size(report_descriptor, desc_size, REPORT_DESCR_INPUT);
13161316
} else {
1317-
dev->max_input_report_size = -1;
1317+
dev->max_input_report_size = 0;
13181318
}
13191319

13201320
dev->input_endpoint = 0;

0 commit comments

Comments
 (0)