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

index d5cf54b6734d6d90fd09f8468133a87a2a503c29..063583c93e93935d2fe92aef4e4ad3e3d0a56383 100644 (file)
@@ -153,10 +153,8 @@ int list_count(t_list *list) {
 
   list_reset(list);
 
-  while(list->current!=NULL) {
-    list_next(list);
-    ++count;
-  }
+  if(list->current!=NULL) count++;
+  while(list_next(list)!=L_NO_NEXT_ELEMENT) count++;
 
   return count;
 }