pkg: fix foreach_list_entry_safe() macro

feature/tap-sh
William Pitcock 2012-05-06 20:36:59 -05:00
parent 3eb16dca0f
commit 0d2a507bcd
1 changed files with 1 additions and 1 deletions

2
pkg.h
View File

@ -60,7 +60,7 @@ typedef struct fragment_ pkg_fragment_t;
for ((value) = (head); (value) != NULL; (value) = (value)->next)
#define foreach_list_entry_safe(head, nextiter, value) \
for ((value) = (head), (nextiter) = (head)->next; (value) != NULL; (value) = (nextiter), (nextiter) = (nextiter)->next)
for ((value) = (head), (nextiter) = (head) != NULL ? (head)->next : NULL; (value) != NULL; (value) = (nextiter), (nextiter) = (nextiter) != NULL ? (nextiter)->next : NULL)
#define LOCAL_COPY(a) \
strcpy(alloca(strlen(a) + 1), a)