From a84b0adb3a6dd2f136bba13b562ab2fd8f403e53 Mon Sep 17 00:00:00 2001 From: Lephenixnoir Date: Fri, 2 Dec 2022 09:56:33 +0100 Subject: [PATCH] jlist: fix jlist_clear() --- src/jlist.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/jlist.c b/src/jlist.c index cf3cdac..2b8ea6d 100644 --- a/src/jlist.c +++ b/src/jlist.c @@ -117,7 +117,9 @@ void jlist_update_model(jlist *l, int item_count) if(l->item_count != item_count) { l->items = realloc(l->items, item_count * sizeof *l->items); if(!l->items) { - item_count = 0; + l->item_count = 0; + l->cursor = -1; + l->widget.dirty = 1; return; } }