]> Pileus Git - wmpus/blobdiff - util.c
Fix list_insert
[wmpus] / util.c
diff --git a/util.c b/util.c
index c5f3b9af021c3351488198be26a5ccbbee8bde20..bf07b0283576cfc2a373609946c9120b18e1b4e5 100644 (file)
--- a/util.c
+++ b/util.c
@@ -11,7 +11,7 @@ list_t *list_insert(list_t *next, void *data)
        node->next = next;
        node->prev = next ? next->prev : NULL;
        if (node->next) node->next->prev = node;
-       if (node->prev) node->next->next = node;
+       if (node->prev) node->prev->next = node;
        return node;
 }