From 721254982e82292d321e7d98480ac6ec22b4a2c6 Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Tue, 1 Sep 2020 16:42:48 +0200 Subject: minor rare bug fix. --- stc/clist.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stc/clist.h b/stc/clist.h index 0b8a6bde..df4d2a19 100644 --- a/stc/clist.h +++ b/stc/clist.h @@ -133,8 +133,8 @@ } \ STC_INLINE void \ clist_##tag##_next(clist_##tag##_iter_t* it) { \ - if (it->item == *it->_last) it->end = it->item = it->item->next; \ - else it->item = it->item->next; \ + it->end = it->item == *it->_last ? it->item->next : NULL; \ + it->item = it->item->next; \ } \ \ STC_API clist_##tag##_iter_t \ -- cgit v1.2.3