Merge branch 'fix' of https://github.com/notsecure/ProjectTox-Core into notsecure-epoll

This commit is contained in:
irungentoo 2014-05-22 16:14:50 -04:00
commit b6cbdefb55
No known key found for this signature in database
GPG Key ID: 10349DC9BED89E98

View File

@ -41,7 +41,7 @@
/* Find data in list /* Find data in list
* *
* return value: * return value:
* >= 0 : id associated with data * >= 0 : index of data in array
* < 0 : no match, returns index (return value is INDEX(index)) where * < 0 : no match, returns index (return value is INDEX(index)) where
* the data should be inserted * the data should be inserted
*/ */
@ -62,7 +62,7 @@ static int find(LIST *list, void *data)
int r = memcmp(data, list->data + list->size * i, list->size); int r = memcmp(data, list->data + list->size * i, list->size);
if (r == 0) { if (r == 0) {
return list->ids[i]; return i;
} }
if (r > 0) { if (r > 0) {
@ -127,7 +127,7 @@ int list_find(LIST *list, void *data)
r = -1; r = -1;
} }
return r; return list->ids[r];
} }
int list_add(LIST *list, void *data, int id) int list_add(LIST *list, void *data, int id)