From: hackbard Date: Mon, 8 Nov 2004 11:46:09 +0000 (+0000) Subject: fixed list api X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d06f6855b63cd0a86eb6ac3948523dbcee997efa;p=my-code%2Fapi.git fixed list api --- diff --git a/list/list.c b/list/list.c index 063583c..a64997f 100644 --- a/list/list.c +++ b/list/list.c @@ -154,7 +154,7 @@ int list_count(t_list *list) { list_reset(list); if(list->current!=NULL) count++; - while(list_next(list)!=L_NO_NEXT_ELEMENT) count++; + if(count) while(list_next(list)!=L_NO_NEXT_ELEMENT) count++; return count; }