From 9fa75ef4d1cc33dfa8037f104d4e8517bae4edf5 Mon Sep 17 00:00:00 2001 From: hermens Date: Thu, 13 Sep 2007 16:37:23 +0000 Subject: [PATCH] Limit the percentage of the progress indicator to reasonable values git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4096 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/Network.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htroot/Network.java b/htroot/Network.java index 80d9ab644..f14e4d8aa 100644 --- a/htroot/Network.java +++ b/htroot/Network.java @@ -496,6 +496,8 @@ public class Network { int percent=(int)((float)(myValue-prevValue)/(float)(nextValue-prevValue)*100); long indexdiff=nextValue-myValue; long ppmdiff=myPPM-nextPPM; + if (percent < 0) percent = -1; + if (percent > 100) percent = 101; prop.put("table_progressbar", 1); //display the bar prop.put("table_progressbar_percent", percent); prop.put("table_progressbar_percent2", 100-percent);