From 32163d80e14206e1f4ce275a7fb828bf2f495656 Mon Sep 17 00:00:00 2001 From: Nikos Ntarmos Date: Mon, 7 Jan 2008 09:29:11 +0100 Subject: [PATCH] Clipping instead of ignoring for progressbar widget FS#25 --- widgets/progressbar.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/widgets/progressbar.c b/widgets/progressbar.c index 2998a4c0..f76370ed 100644 --- a/widgets/progressbar.c +++ b/widgets/progressbar.c @@ -118,8 +118,7 @@ progressbar_tell(Widget *widget, char *command) for (tok = strtok(command, ","); tok && i < d->bars; tok = strtok(NULL, ","), i++) { percent = atoi(tok); - if(percent <= 100 && percent >= 0) - d->percent[i] = percent; + d->percent[i] = (percent < 0 ? 0 : (percent > 100 ? 100 : percent)); } }