]> granicus.if.org Git - sudo/commitdiff
add DEBUG to list2tq
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 6 Mar 2008 17:31:57 +0000 (17:31 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 6 Mar 2008 17:31:57 +0000 (17:31 +0000)
list.c

diff --git a/list.c b/list.c
index 695523b91af8d7cdd2cc55511dd9fa80f2b0c78c..1a17a1d13f94d4a62062ba65152d13f03763b3c3 100644 (file)
--- a/list.c
+++ b/list.c
@@ -82,6 +82,12 @@ list2tq(vh, vl)
     struct list_proto *l = (struct list_proto *)vl;
 
     if (l != NULL) {
+#ifdef DEBUG
+       if (l->prev == NULL) {
+           warningx("list2tq called with non-semicircular list");
+           abort();
+       }
+#endif
        h->first = l;
        h->last = l->prev;      /* l->prev points to the last member of l */
        l->prev = NULL;         /* zero last ptr now that we have a head */