diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-12-19 11:50:32 +0100 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-12-19 11:50:32 +0100 |
commit | 360759610da43faf43bd1c5c5f3e015f953125cb (patch) | |
tree | c249f5127a2f051399baa9a55ba3c5170944f17e /src | |
parent | 3edb3bcabb1c4cb7fbae5b33a26486ef4ef789f8 (diff) | |
download | pa-sink-ctl-360759610da43faf43bd1c5c5f3e015f953125cb.tar.gz pa-sink-ctl-360759610da43faf43bd1c5c5f3e015f953125cb.tar.bz2 pa-sink-ctl-360759610da43faf43bd1c5c5f3e015f953125cb.zip |
interface: Dont allocate volumebar if length is to less
Diffstat (limited to 'src')
-rw-r--r-- | src/interface.c | 2 |
1 files changed, 2 insertions, 0 deletions
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); |