jlist: fix jlist_clear()

This commit is contained in:
Lephenixnoir 2022-12-02 09:56:33 +01:00
parent f5d6fb2e87
commit a84b0adb3a
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
1 changed files with 3 additions and 1 deletions

View File

@ -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;
}
}