summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/llist.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/llist.c b/src/llist.c
index b1c2df7..eeded6b 100644
--- a/src/llist.c
+++ b/src/llist.c
@@ -162,7 +162,7 @@ llist_add_sorted (llist_t *l, void *data, llist_fn_cmp_t fn_cmp)
if (!l->head)
l->head = o;
- else if (fn_cmp(o->data, l->head->data) <= 0)
+ else if (fn_cmp(o->data, l->head->data) < 0)
{
o->next = l->head;
l->head = o;
@@ -170,7 +170,7 @@ llist_add_sorted (llist_t *l, void *data, llist_fn_cmp_t fn_cmp)
else
{
i = l->head;
- while (i->next && fn_cmp(o->data, i->next->data) > 0)
+ while (i->next && fn_cmp(o->data, i->next->data) >= 0)
i = i->next;
o->next = i->next;
i->next = o;