On Thu, Jan 31, 2019 at 05:23:23PM +0200, Gabriel Ivăncescu wrote:
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com
dlls/comctl32/listbox.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-)
diff --git a/dlls/comctl32/listbox.c b/dlls/comctl32/listbox.c index f1ecc52..4ff98d4 100644 --- a/dlls/comctl32/listbox.c +++ b/dlls/comctl32/listbox.c @@ -131,7 +131,8 @@ static BOOL resize_storage(LB_DESCR *descr, UINT items_size) { LB_ITEMDATA *items;
- if (items_size > descr->items_size)
- if (items_size > descr->items_size ||
{ items_size = (items_size + LB_ARRAY_GRANULARITY - 1) & ~(LB_ARRAY_GRANULARITY - 1); items = heap_realloc(descr->items, items_size * sizeof(LB_ITEMDATA));items_size + LB_ARRAY_GRANULARITY * 2 < descr->items_size)
@@ -704,7 +705,9 @@ static void LISTBOX_DrawFocusRect( LB_DESCR *descr, BOOL on ) */ static LRESULT LISTBOX_InitStorage( LB_DESCR *descr, INT nb_items ) {
- if (!resize_storage(descr, descr->nb_items + nb_items))
- UINT new_size = descr->nb_items + nb_items;
- if (new_size > descr->items_size && !resize_storage(descr, new_size)) return LB_ERRSPACE; return descr->items_size;
To avoid patching something you changed in [2/5] you could move this hunk to [2/5].