From 2cbfbef6e55fa7879e159a9bc3ffdad61fdd068d Mon Sep 17 00:00:00 2001 From: irungentoo Date: Fri, 6 Jun 2014 09:00:12 -0400 Subject: [PATCH] Fixed possible bug in list. --- toxcore/list.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/toxcore/list.c b/toxcore/list.c index 95ace12d3..c70601469 100644 --- a/toxcore/list.c +++ b/toxcore/list.c @@ -55,6 +55,10 @@ static int find(LIST *list, void *data) uint32_t i = list->n / 2; //current position in the array uint32_t delta = i / 2; //how much we move in the array + if (!delta) { + delta = 1; + } + int d = -1; //used to determine if closest match is found //closest match is found if we move back to where we have already been