llist_pop error

Rob Landley rob at landley.net
Thu May 11 18:26:38 UTC 2006


On Thursday 11 May 2006 12:34 pm, Vladimir N. Oleynik wrote:
> #ifdef L_llist_pop
> /* Remove first element from the list and return it */
> void *llist_pop(llist_t **head)
> {
> 	void *data;
>
> 	if(!*head) data = *head;
> 	else {
> 		void *next = (*head)->link;
> 		data = (*head)->data;
> -		*head = (*head)->link;
> -		free(next);
> +		free(*head);
> +		*head = next;
> 	}
>
> 	return data;
> }
> #endif

Good catch.

Applied.

> And why not added landley (c) line? ;-)

*shrug*  Didn't seem important.  It's in the svn commit log, I'm not trying to 
change license terms, and I probably have a compliation copyright over the 
versions I package up anyway.

I can if you like...

>
> --w
> vodz

Rob
-- 
Never bet against the cheap plastic solution.



More information about the busybox mailing list