From 360759610da43faf43bd1c5c5f3e015f953125cb Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Mon, 19 Dec 2011 11:50:32 +0100 Subject: interface: Dont allocate volumebar if length is to less --- src/interface.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/interface.c b/src/interface.c index 8c39e06..9c4cdc9 100644 --- a/src/interface.c +++ b/src/interface.c @@ -99,6 +99,8 @@ allocate_volume_bar(struct interface *ifc) getyx(ifc->menu_win, y, x); getmaxyx(ifc->menu_win, max_y, max_x); ifc->volume_bar_len = max_x - x - 8; + if (ifc->volume_bar_len < 0) + return; ifc->volume_bar = g_new(char, ifc->volume_bar_len+1); /* FIXME: if (ifc->volume_bar == NULL) */ memset(ifc->volume_bar, '=', ifc->volume_bar_len); -- cgit