X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=src%2Fclient%2Fwincontrol.c;h=e1a4fbd485a9dd0df65326f6d6d03b2966ee0934;hb=483f25751ae49c810456faf0bb7a375bc437df10;hp=09cff03caaa756b9e095a5ce10b45dc829636da0;hpb=0438f2fc5df337e4264103a86c1765ace9c6565a;p=plomrogue diff --git a/src/client/wincontrol.c b/src/client/wincontrol.c index 09cff03..e1a4fbd 100644 --- a/src/client/wincontrol.c +++ b/src/client/wincontrol.c @@ -328,10 +328,11 @@ extern void resize_active_win(char change) extern void shift_active_win(char dir) { + char * f_name = "shift_active_win()"; uint8_t len_order = strlen(world.winDB.order); if (1 < len_order) { - char tmp[len_order + 1]; + char * tmp = try_malloc(len_order + 1, f_name); tmp[len_order] = '\0'; uint8_t pos = get_win_pos_in_order(world.winDB.active); if ('f' == dir) @@ -362,6 +363,7 @@ extern void shift_active_win(char dir) world.winDB.order[pos - 1] = world.winDB.active; } } + free(tmp); update_wins(get_win_by_id(world.winDB.order[0])); } }