]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
fix for unsinged size_t
authorwessels <>
Thu, 8 Oct 1998 09:17:30 +0000 (09:17 +0000)
committerwessels <>
Thu, 8 Oct 1998 09:17:30 +0000 (09:17 +0000)
src/stat.cc

index 67b9c555755a323cb59be094f9ebd3811e613345..c8ca6fc9f6d4dd35128fe2d1d7df707099944d52 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: stat.cc,v 1.295 1998/10/06 18:32:41 wessels Exp $
+ * $Id: stat.cc,v 1.296 1998/10/08 03:17:30 wessels Exp $
  *
  * DEBUG: section 18    Cache Manager Statistics
  * AUTHOR: Harvest Derived
@@ -1286,7 +1286,11 @@ statByteHitRatio(int minutes)
     assert(minutes < N_COUNT_HIST);
     c = CountHist[0].client_http.kbytes_out.kb - CountHist[minutes].client_http.kbytes_out.kb;
     s = CountHist[0].server.all.kbytes_in.kb - CountHist[minutes].server.all.kbytes_in.kb;
-    return dpercent(c - s, c);
+    /* size_t might be unsigned */
+    if (c > s)
+       return dpercent(c - s, c);
+    else
+       return (-1.0 * dpercent(s - c, c));
 }
 
 #if STAT_GRAPHS