From: Michael D. Lowis Date: Wed, 18 Mar 2020 17:21:16 +0000 (-0400) Subject: fixed bad realloc calls in mons_layer() X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=c8637d71981b97421ed0a48d853ca5764aeb2d28;p=proto%2Fanvil.git fixed bad realloc calls in mons_layer() --- diff --git a/mons.c b/mons.c index 41bae58..b192100 100644 --- a/mons.c +++ b/mons.c @@ -46,7 +46,7 @@ void mons_layer(Monitor* mon) Window* wins = NULL; for (Client* c = mon->cspace->floating; c; c = c->next) { - wins = realloc(wins, ++nwins); + wins = realloc(wins, ++nwins * sizeof(Window)); wins[nwins-1] = c->frame; } /* now lower all of the tiled windows */ @@ -54,7 +54,7 @@ void mons_layer(Monitor* mon) { for (Client* c = col->clients; c; c = c->next) { - wins = realloc(wins, ++nwins); + wins = realloc(wins, ++nwins * sizeof(Window)); wins[nwins-1] = c->frame; } }