From 3088305166df1532778e88a96a293f88315f9f25 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 17 Oct 2018 21:05:33 +0200 Subject: list: fix double avaluation in LIST_APPEND() --- src/basic/list.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/basic/list.h') diff --git a/src/basic/list.h b/src/basic/list.h index 643e0bea88..040680c30a 100644 --- a/src/basic/list.h +++ b/src/basic/list.h @@ -38,9 +38,9 @@ /* Append an item to the list */ #define LIST_APPEND(name,head,item) \ do { \ - typeof(*(head)) *_tail; \ - LIST_FIND_TAIL(name,head,_tail); \ - LIST_INSERT_AFTER(name,head,_tail,item); \ + typeof(*(head)) **_hhead = &(head), *_tail; \ + LIST_FIND_TAIL(name, *_hhead, _tail); \ + LIST_INSERT_AFTER(name, *_hhead, _tail, item); \ } while (false) /* Remove an item from the list */ -- cgit v1.2.3