Changes in uspace/lib/usb/src/hidparser.c [3b77628:ad4562c2] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/src/hidparser.c
r3b77628 rad4562c2 35 35 #include <usb/classes/hidparser.h> 36 36 #include <errno.h> 37 #include <stdio.h> 37 38 38 39 /** Parse HID report descriptor. … … 120 121 item.logical_max = 255; 121 122 122 if (size != 8){123 return -1;123 if (size != 8) { 124 return ERANGE; 124 125 } 125 126 126 127 uint8_t keys[6]; 127 for (i=item.offset; i<item.count; i++) {128 keys[i -2] = data[i];128 for (i = 0; i < item.count; i++) { 129 keys[i] = data[i + item.offset]; 129 130 } 130 131 … … 143 144 int usb_hid_boot_keyboard_output_report(uint8_t leds, uint8_t *data, size_t size) 144 145 { 145 if (size !=1){146 if (size < 1){ 146 147 return -1; 147 148 } 148 149 149 /* used only first five bits, others are only padding*/ 150 *data = leds; 150 data[0] = leds; 151 151 return EOK; 152 152 }
Note:
See TracChangeset
for help on using the changeset viewer.