From 49ab5ac0e557d030f0a3c1ed340c07aa013f4e0b Mon Sep 17 00:00:00 2001 From: notsecure Date: Thu, 22 May 2014 16:06:12 -0400 Subject: [PATCH] fixed list_remove --- toxcore/list.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/toxcore/list.c b/toxcore/list.c index 2904d15b..bf22f799 100644 --- a/toxcore/list.c +++ b/toxcore/list.c @@ -41,7 +41,7 @@ /* Find data in list * * return value: - * >= 0 : id associated with data + * >= 0 : index of data in array * < 0 : no match, returns index (return value is INDEX(index)) where * 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); if (r == 0) { - return list->ids[i]; + return i; } if (r > 0) { @@ -127,7 +127,7 @@ int list_find(LIST *list, void *data) r = -1; } - return r; + return list->ids[r]; } int list_add(LIST *list, void *data, int id)