From: wessels <> Date: Thu, 8 Oct 1998 09:17:30 +0000 (+0000) Subject: fix for unsinged size_t X-Git-Tag: SQUID_3_0_PRE1~2602 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=94e56ef70bf05fb7850701c42652706b1030b644;p=thirdparty%2Fsquid.git fix for unsinged size_t --- diff --git a/src/stat.cc b/src/stat.cc index 67b9c55575..c8ca6fc9f6 100644 --- a/src/stat.cc +++ b/src/stat.cc @@ -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