From 0eb947b47b934b7e24d58030eecf740a39e95822 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Fri, 21 Jan 2011 07:04:26 +0000 Subject: [PATCH] fix weight calcs! SVN revision: 56252 --- src/bin/ui.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/bin/ui.c b/src/bin/ui.c index 235e78e..b579c50 100644 --- a/src/bin/ui.c +++ b/src/bin/ui.c @@ -229,7 +229,10 @@ _ui_all(void) wfps += (p_fps * weights[t_count]); key_func("Escape"); } - for (i = 1; i < ((sizeof(weights) / sizeof(double)) - 1); i++) + for (i = 1; + (i < ((sizeof(weights) / sizeof(double)) - 1)) && + (weights[i] > 0.0); + i++) avgw += weights[i]; avgw /= (i - 1); if (t_count > 0)