From: hackbard Date: Mon, 8 Nov 2004 12:16:12 +0000 (+0000) Subject: another bugfix X-Git-Url: https://hackdaworld.org/gitweb/?p=my-code%2Fapi.git;a=commitdiff_plain;h=8e2aee37f009e1a796e68ac36e8a1782091422e5 another bugfix --- diff --git a/list/list.c b/list/list.c index a64997f..13493e6 100644 --- a/list/list.c +++ b/list/list.c @@ -83,11 +83,11 @@ int list_search_data(t_list *list,void *data,int first_bytes) { list_reset(list); - while(list->current!=NULL) { - if(first_bytes<=list->current->data_len) - if(!(memcmp(list->current->data,data,first_bytes))) return L_SUCCESS; - list_next(list); - } + do { + if(list->current!=NULL) + if(first_bytes<=list->current->data_len) + if(!(memcmp(list->current->data,data,first_bytes))) return L_SUCCESS; + } while(list_next(list)!=L_NO_NEXT_ELEMENT); return L_NO_SUCH_ELEMENT; }