]> hackdaworld.org Git - my-code/api.git/commitdiff
fixed list api
authorhackbard <hackbard>
Mon, 8 Nov 2004 11:46:09 +0000 (11:46 +0000)
committerhackbard <hackbard>
Mon, 8 Nov 2004 11:46:09 +0000 (11:46 +0000)
list/list.c

index 063583c93e93935d2fe92aef4e4ad3e3d0a56383..a64997f8688f315af954bc052a04fe7b83e4bfef 100644 (file)
@@ -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;
 }