]> hackdaworld.org Git - my-code/api.git/commitdiff
another bugfix
authorhackbard <hackbard>
Mon, 8 Nov 2004 12:16:12 +0000 (12:16 +0000)
committerhackbard <hackbard>
Mon, 8 Nov 2004 12:16:12 +0000 (12:16 +0000)
list/list.c

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