From: Ondrej Zajicek Date: Mon, 12 Jan 2009 13:40:21 +0000 (+0100) Subject: Slist update X-Git-Tag: v1.2.0~156 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=02a9eeeb8547b3f0940a0295df8a78ce2181ec30;p=thirdparty%2Fbird.git Slist update --- diff --git a/lib/slists.c b/lib/slists.c index 357743019..6e0df39e1 100644 --- a/lib/slists.c +++ b/lib/slists.c @@ -61,6 +61,9 @@ s_get(siterator *i) f->next = g; if (g) g->prev = f; + + i->prev = NULL; + i->next = NULL; return n; } diff --git a/lib/slists.h b/lib/slists.h index 27520c9f6..2334e36a5 100644 --- a/lib/slists.h +++ b/lib/slists.h @@ -84,5 +84,6 @@ void s_insert_node(snode *, snode *); snode *s_get(siterator *); void s_put(siterator *, snode *n); static inline void s_init(siterator *i, slist *l) { s_put(i, SHEAD(*l)); } +static inline int s_is_used(siterator *i) { return (i->prev != NULL); } #endif