]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Compare correctly a per user limit greater than 2GB
authorFrederic Marchal <fmarchal@users.sourceforge.net>
Wed, 29 May 2013 19:54:21 +0000 (21:54 +0200)
committerFrederic Marchal <fmarchal@users.sourceforge.net>
Wed, 29 May 2013 19:54:21 +0000 (21:54 +0200)
A user limit greater than 2GB would sometime list the user into the
limit file even though the user does not exceed the limit.

Thanks to RodinM for reporting this bug.

html.c

diff --git a/html.c b/html.c
index b23ce108e972539c4e47645bf3990f40f05984c2..cd3ed482343c8082ccbc458a616eb8ebf02c0179 100644 (file)
--- a/html.c
+++ b/html.c
@@ -528,7 +528,7 @@ void htmlrel(void)
                }
 
                if(PerUserLimit > 0) {
-                       if(tnbytes > (PerUserLimit*1000000)) {
+                       if(tnbytes/1000000LL > PerUserLimit) {
                                limit_flag=0;
                                if(access(PerUserLimitFile, R_OK) == 0) {
                                        if((fp_usr = fopen(PerUserLimitFile, "r")) == 0) {