]> hackdaworld.org Git - my-code/api.git/commitdiff
hopefully final bugfix to not et segfaulst using list_next
authorhackbard <hackbard>
Mon, 8 Nov 2004 12:34:36 +0000 (12:34 +0000)
committerhackbard <hackbard>
Mon, 8 Nov 2004 12:34:36 +0000 (12:34 +0000)
list/list.c

index 13493e6dc4461ebc403298c9a54e148ef72ef157..0cfb44166f0f99184c8dfbeb488b5e5a15d03eba 100644 (file)
@@ -83,6 +83,11 @@ int list_search_data(t_list *list,void *data,int first_bytes) {
 
   list_reset(list);
 
+  if(list->start==NULL) {
+    dprintf(list->outfd,"[list] empty list\n");
+    return L_EMPTY_LIST;
+  }
+
   do {
     if(list->current!=NULL)
       if(first_bytes<=list->current->data_len)