shithub: orca

Download patch

ref: 31c73ec1fd032071632c3b0f089908a7aea2b916
parent: 4eaf6fdb803f1ef724252c9af4c76fad0d4bf1e0
author: cancel <cancel@cancel.fm>
date: Sun Jan 5 21:36:06 EST 2020

Fix wrong counter check

--- a/term_util.c
+++ b/term_util.c
@@ -325,7 +325,7 @@
   if (new_count > items_cap) {
     // todo overflow check, realloc fail check
     Usz old_cap = items_cap;
-    Usz new_cap = count < 16 ? 16 : orca_round_up_power2(new_count);
+    Usz new_cap = new_count < 16 ? 16 : orca_round_up_power2(new_count);
     Usz new_size = new_cap * (sizeof(ITEM*) + sizeof(struct Qmenu_item_extra));
     ITEM** new_items = (ITEM**)realloc(items, new_size);
     if (!new_items)