From 31136eb80c62449b644288e1563ff6fe57d3f9c5 Mon Sep 17 00:00:00 2001 From: Frederic Culot Date: Tue, 23 Mar 2010 13:08:46 +0000 Subject: Check added to avoid problems in case side bar width is not found in configuration file. --- ChangeLog | 6 ++++++ src/wins.c | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 92a87a2..7b63041 100755 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-03-23 Frederic Culot + + * src/wins.c (wins_sbar_winc): test added to avoid problems if + user does not have side bar width specified in its configuration + file + 2010-03-22 Frederic Culot * src/calcurse.h: compilation issue related to memory functions diff --git a/src/wins.c b/src/wins.c index cfe1050..d1ddc1b 100755 --- a/src/wins.c +++ b/src/wins.c @@ -1,4 +1,4 @@ -/* $calcurse: wins.c,v 1.32 2010/03/21 10:17:04 culot Exp $ */ +/* $calcurse: wins.c,v 1.33 2010/03/23 13:08:46 culot Exp $ */ /* * Calcurse - text-based organizer @@ -179,7 +179,9 @@ wins_set_sbar_width (unsigned perc) void wins_sbar_winc (void) { - if (sbarwidth < SBARMAXWIDTHPERC * col / 100) + if (sbarwidth < SBARMINWIDTH) + sbarwidth = SBARMINWIDTH + 1; + else if (sbarwidth < SBARMAXWIDTHPERC * col / 100) sbarwidth++; } -- cgit v1.2.3