]> hackdaworld.org Git - my-code/api.git/commitdiff
point to added list element in case after adding an element
authorhackbard <hackbard>
Fri, 10 Jun 2005 16:06:55 +0000 (16:06 +0000)
committerhackbard <hackbard>
Fri, 10 Jun 2005 16:06:55 +0000 (16:06 +0000)
list/list.c

index 0cfb44166f0f99184c8dfbeb488b5e5a15d03eba..64a104a1cd3f7e0eb651e60cfc5782e07b898960 100644 (file)
@@ -123,6 +123,8 @@ int list_add_element(t_list *list,void *data,int data_len) {
       memcpy(list->current->next->data,data,data_len);
       list->current->next->data_len=data_len;
 
+      list->current=list->current->next;
+
       dprintf(list->outfd,"[list] element added\n");
 
       return L_SUCCESS;
@@ -145,6 +147,8 @@ int list_add_element(t_list *list,void *data,int data_len) {
   list->start->next=NULL;
   list->start->prev=NULL;
 
+  list->current=list->start;
+
   dprintf(list->outfd,"[list] added initial element\n");
 
   return L_SUCCESS;