From 65cbd6ca1da0d802ac39b460dcb8ae0af3762c13 Mon Sep 17 00:00:00 2001 From: Luke Heberling Date: Thu, 13 Dec 2007 08:06:26 +0100 Subject: [PATCH] rc/utils_llist.c: Fix a bug in llist_prepend. Copy the element to the tail if it's the first element. --- src/utils_llist.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/utils_llist.c b/src/utils_llist.c index d8694e3f..d5db9dc0 100644 --- a/src/utils_llist.c +++ b/src/utils_llist.c @@ -110,6 +110,9 @@ void llist_prepend (llist_t *l, llentry_t *e) { e->next = l->head; l->head = e; + + if (l->tail == NULL) + l->tail = e; } void llist_remove (llist_t *l, llentry_t *e) -- 2.11.0