Changes in uspace/app/vuhid/device.c [9a884ed:e6503e9] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/vuhid/device.c
r9a884ed re6503e9 36 36 #include "virthid.h" 37 37 #include <errno.h> 38 #include <stdio.h> 38 39 #include <str.h> 39 40 #include <assert.h> … … 95 96 const char *id) 96 97 { 97 vuhid_interface_t *iface = ifaces[0]; 98 while (iface != NULL) { 99 if (str_cmp(iface->id, id) == 0) { 100 return iface; 98 if ((ifaces == NULL) || (id == NULL)) { 99 return NULL; 100 } 101 while (*ifaces != NULL) { 102 if (str_cmp((*ifaces)->id, id) == 0) { 103 return *ifaces; 101 104 } 102 iface ++;103 } 104 105 return iface;105 ifaces++; 106 } 107 108 return NULL; 106 109 } 107 110 … … 118 121 } 119 122 120 // FIXME - we shall set vuhid_data to NULL in the main() rather121 // than to depend on individual interfaces122 123 /* Already used interface. */ 123 124 if (iface->vuhid_data != NULL) { … … 165 166 * Prepare new descriptors. 166 167 */ 167 printf("preparing descriptors...\n");168 168 size_t descr_count = 0; 169 169 size_t total_descr_size = 0; … … 272 272 } 273 273 274 printf("adding extra descriptors...\n");275 274 /* Allocation is okay, we can (actually have to now) overwrite the 276 275 * original pointer.
Note:
See TracChangeset
for help on using the changeset viewer.