]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Limit the number of top users reported in the mail report
authorFrederic Marchal <fmarchal@users.sourceforge.net>
Fri, 17 Jul 2015 19:34:17 +0000 (21:34 +0200)
committerFrederic Marchal <fmarchal@users.sourceforge.net>
Fri, 17 Jul 2015 19:34:17 +0000 (21:34 +0200)
The topuser_num parameter in sarg limits the number of users reported in
the email report. Set it to zero to report every user as was done before.

Thanks to Yakushev Evgeniy for reporting this limitation.

email.c

diff --git a/email.c b/email.c
index 565c68a6dd212c9d14f4a2380bdce2de3bfa85eb..2a70dfe19b24dc5daf52902f082cb1dcb7a5edbe 100644 (file)
--- a/email.c
+++ b/email.c
@@ -193,7 +193,7 @@ int geramail(const char *dirname, int debug, const char *email, const char *Temp
 
        fprintf(fp_top3,"%-7s %-20s %-8s %-15s %%%-6s %-10s %-10s %%%-7s\n------- -------------------- -------- --------------- ------- ---------- ---------- -------\n",strip1,strip2,strip3,strip4,strip4,strip5,strip6,strip7);
 
-       while(fgets(warea,sizeof(warea),fp_top1)) {
+       while ((TopUsersNum==0 || posicao<TopUsersNum) && fgets(warea,sizeof(warea),fp_top1)) {
                fixendofline(warea);
                getword_start(&gwarea,warea);
                if (getword(user,sizeof(user),&gwarea,'\t')<0) {