summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2020-09-01 16:42:48 +0200
committerTyge Løvset <[email protected]>2020-09-01 16:42:48 +0200
commit721254982e82292d321e7d98480ac6ec22b4a2c6 (patch)
treecec56d074c79a0328fc146e0bf67e3f6e88f77a5
parent4021220d0b4c6508ec7c500c32b133459b6ad51e (diff)
downloadSTC-modified-721254982e82292d321e7d98480ac6ec22b4a2c6.tar.gz
STC-modified-721254982e82292d321e7d98480ac6ec22b4a2c6.zip
minor rare bug fix.
-rw-r--r--stc/clist.h4
1 files 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 \