From 007905af8b7883d211a3da552f27a54d10b12769 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Marchal?= Date: Sun, 26 Dec 2010 11:13:16 +0000 Subject: [PATCH] Fix indentation of the code The replacement of spaces by tabs to indent the code increased the missalignement of the code where the indentation was already wrong. --- auth.c | 2 +- authfail.c | 8 +++---- btree_cache.c | 2 +- dansguardian_log.c | 8 +++---- dansguardian_report.c | 12 +++++----- datafile.c | 6 ++--- denied.c | 10 ++++----- download.c | 2 +- email.c | 6 ++--- exclude.c | 10 ++++----- grepday.c | 6 ++--- html.c | 5 ----- index.c | 2 +- ip2name.c | 2 +- lastlog.c | 8 +++---- log.c | 51 +++++++++++++++++++------------------------ repday.c | 8 +++---- report.c | 17 +++++++-------- siteuser.c | 10 ++++----- smartfilter.c | 8 +++---- sort.c | 4 ++-- squidguard_log.c | 4 ++-- squidguard_report.c | 8 +++---- topsites.c | 14 ++++++------ totday.c | 4 ++-- useragent.c | 4 ++-- usertab.c | 2 +- util.c | 34 +++++------------------------ 28 files changed, 111 insertions(+), 146 deletions(-) diff --git a/auth.c b/auth.c index 42cbe45..fab5d65 100644 --- a/auth.c +++ b/auth.c @@ -59,7 +59,7 @@ void htaccess(const struct userinfostruct *uinfo) i++; } else { fputc(line[i],fp_auth); - } + } } fclose(fp_auth); fclose(fp_in); diff --git a/authfail.c b/authfail.c index 875053c..434bb47 100644 --- a/authfail.c +++ b/authfail.c @@ -85,8 +85,8 @@ void authfail_report(void) unlink(tmp4); if((fp_ou=MY_FOPEN(report,"w"))==NULL) { - debuga(_("(authfail) Cannot open file %s\n"),report); - exit(EXIT_FAILURE); + debuga(_("(authfail) Cannot open file %s\n"),report); + exit(EXIT_FAILURE); } write_html_header(fp_ou,(IndexTree == INDEX_TREE_DATE) ? 3 : 1,_("Authentication Failures"),HTML_JS_NONE); @@ -153,8 +153,8 @@ void authfail_report(void) } } - if(AuthfailReportLimit>0) { - if(strcmp(ouser2,uinfo->label) == 0) { + if(AuthfailReportLimit>0) { + if(strcmp(ouser2,uinfo->label) == 0) { count++; } else { count=1; diff --git a/btree_cache.c b/btree_cache.c index 5cd15c6..3b4aa34 100644 --- a/btree_cache.c +++ b/btree_cache.c @@ -258,7 +258,7 @@ void balance_node(struct bt *node) rotate_left(node); break; default: - exit(EXIT_FAILURE); + exit(EXIT_FAILURE); break; } diff --git a/dansguardian_log.c b/dansguardian_log.c index 5fa1cca..a90367e 100644 --- a/dansguardian_log.c +++ b/dansguardian_log.c @@ -94,9 +94,9 @@ void dansguardian_log(void) continue; getword_start(&gwarea,buf); if (getword(year,sizeof(year),&gwarea,'.')<0 || getword(mon,sizeof(mon),&gwarea,'.')<0 || - getword(day,sizeof(day),&gwarea,' ')<0 || getword(hour,sizeof(hour),&gwarea,' ')<0 || - getword(user,sizeof(user),&gwarea,' ')<0 || getword(ip,sizeof(ip),&gwarea,' ')<0 || - getword_skip(MAXLEN,&gwarea,'/')<0 || getword_skip(MAXLEN,&gwarea,'/')<0) { + getword(day,sizeof(day),&gwarea,' ')<0 || getword(hour,sizeof(hour),&gwarea,' ')<0 || + getword(user,sizeof(user),&gwarea,' ')<0 || getword(ip,sizeof(ip),&gwarea,' ')<0 || + getword_skip(MAXLEN,&gwarea,'/')<0 || getword_skip(MAXLEN,&gwarea,'/')<0) { debuga(_("Maybe you have a broken record or garbage in your %s file\n"),loglocation); exit(EXIT_FAILURE); } @@ -105,7 +105,7 @@ void dansguardian_log(void) exit(EXIT_FAILURE); } if (getword_skip(255,&gwarea,' ')<0 || - getword(code1,sizeof(code1),&gwarea,' ')<0 || getword(code2,sizeof(code2),&gwarea,' ')<0) { + getword(code1,sizeof(code1),&gwarea,' ')<0 || getword(code2,sizeof(code2),&gwarea,' ')<0) { debuga(_("Maybe you have a broken record or garbage in your %s file\n"),loglocation); exit(EXIT_FAILURE); } diff --git a/dansguardian_report.c b/dansguardian_report.c index 122769e..0ff685f 100644 --- a/dansguardian_report.c +++ b/dansguardian_report.c @@ -59,13 +59,13 @@ void dansguardian_report(void) sprintf(report,"%s/dansguardian.html",outdirname); if((fp_in=MY_FOPEN(dansguardian_in,"r"))==NULL) { - debuga(_("(dansguardian_report) Cannot open log file %s\n"),dansguardian_in); - exit(EXIT_FAILURE); + debuga(_("(dansguardian_report) Cannot open log file %s\n"),dansguardian_in); + exit(EXIT_FAILURE); } if((fp_ou=MY_FOPEN(report,"w"))==NULL) { - debuga(_("(dansguardian_report) Cannot open log file %s\n"),report); - exit(EXIT_FAILURE); + debuga(_("(dansguardian_report) Cannot open log file %s\n"),report); + exit(EXIT_FAILURE); } write_html_header(fp_ou,(IndexTree == INDEX_TREE_DATE) ? 3 : 1,_("DansGuardian"),HTML_JS_NONE); @@ -81,7 +81,7 @@ void dansguardian_report(void) while(fgets(buf,sizeof(buf),fp_in)!=NULL) { getword_start(&gwarea,buf); if (getword(user,sizeof(user),&gwarea,'\t')<0 || getword(date2,sizeof(date2),&gwarea,'\t')<0 || - getword(hour,sizeof(hour),&gwarea,'\t')<0 || getword(ip,sizeof(ip),&gwarea,'\t')<0) { + getword(hour,sizeof(hour),&gwarea,'\t')<0 || getword(ip,sizeof(ip),&gwarea,'\t')<0) { debuga(_("Maybe you have a broken record or garbage in your %s file\n"),dansguardian_in); exit(EXIT_FAILURE); } @@ -132,7 +132,7 @@ void dansguardian_report(void) user_find(name, sizeof(name), user); - if(DansGuardianReportLimit) { + if(DansGuardianReportLimit) { if(strcmp(ouser2,name) == 0) { count++; } else { diff --git a/datafile.c b/datafile.c index 485f203..36af6ae 100644 --- a/datafile.c +++ b/datafile.c @@ -123,9 +123,9 @@ void data_file(char *tmp) while((buf=longline_read(fp_in,line))!=NULL) { getword_start(&gwarea,buf); if (getword(accdia,sizeof(accdia),&gwarea,'\t')<0 || getword(acchora,sizeof(acchora),&gwarea,'\t')<0 || - getword(accip,sizeof(accip),&gwarea,'\t')<0 || - getword_ptr(buf,&accurl,&gwarea,'\t')<0 || getword_atoll(&accbytes,&gwarea,'\t')<0 || - getword(acccode,sizeof(acccode),&gwarea,'\t')<0 || getword_atoll(&accelap,&gwarea,'\t')<0) { + getword(accip,sizeof(accip),&gwarea,'\t')<0 || + getword_ptr(buf,&accurl,&gwarea,'\t')<0 || getword_atoll(&accbytes,&gwarea,'\t')<0 || + getword(acccode,sizeof(acccode),&gwarea,'\t')<0 || getword_atoll(&accelap,&gwarea,'\t')<0) { debuga(_("There is a broken record or garbage in file %s\n"),tmp3); exit(EXIT_FAILURE); } diff --git a/denied.c b/denied.c index 5d2288e..bf6bf56 100644 --- a/denied.c +++ b/denied.c @@ -71,13 +71,13 @@ void gen_denied_report(void) sprintf(report,"%s/denied.html",outdirname); if((fp_in=MY_FOPEN(denied_in,"r"))==NULL) { - debuga(_("(denied) Cannot open log file %s\n"),denied_in); - exit(EXIT_FAILURE); + debuga(_("(denied) Cannot open log file %s\n"),denied_in); + exit(EXIT_FAILURE); } if((fp_ou=MY_FOPEN(report,"w"))==NULL) { - debuga(_("(denied) Cannot open log file %s\n"),report); - exit(EXIT_FAILURE); + debuga(_("(denied) Cannot open log file %s\n"),report); + exit(EXIT_FAILURE); } write_html_header(fp_ou,(IndexTree == INDEX_TREE_DATE) ? 3 : 1,_("Denied"),HTML_JS_NONE); @@ -98,7 +98,7 @@ void gen_denied_report(void) while((buf=longline_read(fp_in,line))!=NULL) { getword_start(&gwarea,buf); if (getword(data,sizeof(data),&gwarea,'\t')<0 || getword(hora,sizeof(hora),&gwarea,'\t')<0 || - getword(user,sizeof(user),&gwarea,'\t')<0 || getword(ip,sizeof(ip),&gwarea,'\t')<0) { + getword(user,sizeof(user),&gwarea,'\t')<0 || getword(ip,sizeof(ip),&gwarea,'\t')<0) { debuga(_("There is a broken record or garbage in file %s\n"),denied_in); exit(EXIT_FAILURE); } diff --git a/download.c b/download.c index 0695da1..a490952 100644 --- a/download.c +++ b/download.c @@ -93,7 +93,7 @@ void download_report(void) while((buf=longline_read(fp_in,line))!=NULL) { getword_start(&gwarea,buf); if (getword(data,sizeof(data),&gwarea,'\t')<0 || getword(hora,sizeof(hora),&gwarea,'\t')<0 || - getword(user,sizeof(user),&gwarea,'\t')<0 || getword(ip,sizeof(ip),&gwarea,'\t')<0) { + getword(user,sizeof(user),&gwarea,'\t')<0 || getword(ip,sizeof(ip),&gwarea,'\t')<0) { debuga(_("There is a broken record or garbage in file %s\n"),report_in); exit(EXIT_FAILURE); } diff --git a/email.c b/email.c index 3188b79..704d4e1 100644 --- a/email.c +++ b/email.c @@ -80,8 +80,7 @@ int geramail(const char *dirname, int debug, const char *outdir, const char *ema while((buf=longline_read(fp_in,line))!=NULL) { ger_read(buf,&item,wger); if(item.total) continue; - if(strcmp(olduser,item.user) != 0) - { + if(strcmp(olduser,item.user) != 0) { totuser++; if (olduser[0] != '\0') { @@ -170,8 +169,7 @@ int geramail(const char *dirname, int debug, const char *outdir, const char *ema 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(fgets(warea,sizeof(warea),fp_top1)) { fixendofline(warea); getword_start(&gwarea,warea); if (getword(user,sizeof(user),&gwarea,'\t')<0) { diff --git a/exclude.c b/exclude.c index 0ccfb07..c60c0a1 100644 --- a/exclude.c +++ b/exclude.c @@ -347,11 +347,11 @@ void getuexclude(const char *uexfile, int debug) bzero(excludeuser,nreg); while(fgets(buf,sizeof(buf),fp_ex)!=NULL){ - if(strchr(buf,'#') != NULL) - continue; - fixendofline(buf); - strcat(excludeuser,buf); - strcat(excludeuser," "); + if(strchr(buf,'#') != NULL) + continue; + fixendofline(buf); + strcat(excludeuser,buf); + strcat(excludeuser," "); } strcat(excludeuser,"*END* "); diff --git a/grepday.c b/grepday.c index 87829a0..3be390b 100644 --- a/grepday.c +++ b/grepday.c @@ -122,7 +122,7 @@ iconv_t localtoutf=(iconv_t)-1; #endif static void Sarg_gdImageStringFT (struct GraphDataStruct *gdata, int fg, char *fontlist, - double ptsize, double angle, int x, int y, const char *string,enum TextRefPos RefPos) + double ptsize, double angle, int x, int y, const char *string,enum TextRefPos RefPos) { char *sstring; char *retval; @@ -720,8 +720,8 @@ void greport_day(const struct userinfostruct *uinfo) exit(EXIT_FAILURE); } if ((fp_ou=fopen(wdirname,"wt"))==NULL) { - debuga(_("(grepday) Cannot open output file %s\n"),wdirname); - exit(EXIT_FAILURE); + debuga(_("(grepday) Cannot open output file %s\n"),wdirname); + exit(EXIT_FAILURE); } write_html_head(fp_ou,(IndexTree == INDEX_TREE_DATE) ? 4 : 2,_("Graph report"),HTML_JS_NONE); diff --git a/html.c b/html.c index a6beae5..5e8839e 100644 --- a/html.c +++ b/html.c @@ -591,11 +591,6 @@ void htmlrel(void) } } -// if(indexonly) { -// unlink(arqou); -// continue; -// } - if ((ReportType & REPORT_TYPE_TOPUSERS) != 0 && (UserReportFields & USERREPORTFIELDS_AVERAGE) != 0) { totbytes2=totbytes/ntotuser; totelap2=totelap/ntotuser; diff --git a/index.c b/index.c index a685f8e..1f87792 100644 --- a/index.c +++ b/index.c @@ -109,7 +109,7 @@ static void make_date_index(void) } while ((direntp = readdir( dirp )) != NULL) { if(strlen(direntp->d_name) > 4 || !isdigit(direntp->d_name[0]) || !isdigit(direntp->d_name[1]) || - !isdigit(direntp->d_name[2]) || !isdigit(direntp->d_name[3])) continue; + !isdigit(direntp->d_name[2]) || !isdigit(direntp->d_name[3])) continue; year=atoi(direntp->d_name); if (nyears>=sizeof(yearsort)/sizeof(yearsort[0])) { /* diff --git a/ip2name.c b/ip2name.c index 4ae79bb..066c596 100644 --- a/ip2name.c +++ b/ip2name.c @@ -105,7 +105,7 @@ void name2ip(char *name) ia.s_addr=ntohl(ia.s_addr); getword_start(&gwarea,inet_ntoa(ia)); if (getword(n4,sizeof(n4),&gwarea,'.')<0 || getword(n3,sizeof(n3),&gwarea,'.')<0 || - getword(n2,sizeof(n2),&gwarea,'.')<0 || getword(n1,sizeof(n1),&gwarea,0)<0) { + getword(n2,sizeof(n2),&gwarea,'.')<0 || getword(n1,sizeof(n1),&gwarea,0)<0) { printf("SARG: Maybe you have a broken record or garbage in your %s ip address.\n",gwarea.beginning); exit(EXIT_FAILURE); } diff --git a/lastlog.c b/lastlog.c index 2252baf..8b71d05 100644 --- a/lastlog.c +++ b/lastlog.c @@ -48,8 +48,8 @@ void mklastlog(const char *outdir) snprintf(temp,sizeof(temp),"%slastlog1",outdir); if((fp_ou=fopen(temp,"w"))==NULL) { - debuga(_("(lastlog) Cannot open temporary file %s\n"),temp); - exit(EXIT_FAILURE); + debuga(_("(lastlog) Cannot open temporary file %s\n"),temp); + exit(EXIT_FAILURE); } if ((dirp = opendir(outdir)) == NULL) { @@ -96,8 +96,8 @@ void mklastlog(const char *outdir) snprintf(temp,sizeof(temp),"%slastlog",outdir); if((fp_in=fopen(temp,"r"))==NULL) { - debuga(_("(lastlog) Cannot open temporary file %s\n"),temp); - exit(EXIT_FAILURE); + debuga(_("(lastlog) Cannot open temporary file %s\n"),temp); + exit(EXIT_FAILURE); } while(ftot>0 && fgets(buf,sizeof(buf),fp_in)!=NULL) { diff --git a/log.c b/log.c index f25a850..2f115f2 100644 --- a/log.c +++ b/log.c @@ -44,8 +44,7 @@ struct userfilestruct /*@null@*/static char *userfile=NULL; numlist weekdays = { { 0, 1, 2, 3, 4, 5, 6 }, 7 }; -numlist hours = { { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 }, 24 }; +numlist hours = { { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 }, 24 }; static void getusers(const char *pwdfile, int debug); @@ -248,15 +247,15 @@ int main(int argc,char *argv[]) strcpy(PrivacyStringColor,"blue"); SuccessfulMsg=true; TopUserFields=TOPUSERFIELDS_NUM | TOPUSERFIELDS_DATE_TIME | TOPUSERFIELDS_USERID | TOPUSERFIELDS_CONNECT | - TOPUSERFIELDS_BYTES | TOPUSERFIELDS_SETYB | TOPUSERFIELDS_IN_CACHE_OUT | - TOPUSERFIELDS_USED_TIME | TOPUSERFIELDS_MILISEC | TOPUSERFIELDS_PTIME | - TOPUSERFIELDS_TOTAL | TOPUSERFIELDS_AVERAGE; + TOPUSERFIELDS_BYTES | TOPUSERFIELDS_SETYB | TOPUSERFIELDS_IN_CACHE_OUT | + TOPUSERFIELDS_USED_TIME | TOPUSERFIELDS_MILISEC | TOPUSERFIELDS_PTIME | + TOPUSERFIELDS_TOTAL | TOPUSERFIELDS_AVERAGE; UserReportFields=USERREPORTFIELDS_CONNECT | USERREPORTFIELDS_BYTES | USERREPORTFIELDS_SETYB | - USERREPORTFIELDS_IN_CACHE_OUT | USERREPORTFIELDS_USED_TIME | USERREPORTFIELDS_MILISEC | - USERREPORTFIELDS_PTIME | USERREPORTFIELDS_TOTAL | USERREPORTFIELDS_AVERAGE; + USERREPORTFIELDS_IN_CACHE_OUT | USERREPORTFIELDS_USED_TIME | USERREPORTFIELDS_MILISEC | + USERREPORTFIELDS_PTIME | USERREPORTFIELDS_TOTAL | USERREPORTFIELDS_AVERAGE; strcpy(DataFileDelimiter,";"); DataFileFields=DATA_FIELD_USER | DATA_FIELD_DATE | DATA_FIELD_TIME | DATA_FIELD_URL | DATA_FIELD_CONNECT | - DATA_FIELD_BYTES | DATA_FIELD_IN_CACHE | DATA_FIELD_OUT_CACHE | DATA_FIELD_ELAPSED; + DATA_FIELD_BYTES | DATA_FIELD_IN_CACHE | DATA_FIELD_OUT_CACHE | DATA_FIELD_ELAPSED; ShowReadStatistics=true; strcpy(IndexSortOrder,"D"); ShowSargInfo=true; @@ -489,10 +488,9 @@ int main(int argc,char *argv[]) case 'z': debugz++; break; - /*case ':': - debuga(_("Option -%c require an argument\n"),optopt); - errflg++; - break;*/ + case ':': + debuga(_("Option -%c requires an argument\n"),optopt); + exit(EXIT_FAILURE); case '?': usage(argv[0]); exit(EXIT_FAILURE); @@ -589,8 +587,8 @@ int main(int argc,char *argv[]) if(ReportType == 0) { ReportType=REPORT_TYPE_TOPUSERS | REPORT_TYPE_TOPSITES | REPORT_TYPE_USERS_SITES | - REPORT_TYPE_SITES_USERS | REPORT_TYPE_DATE_TIME | REPORT_TYPE_DENIED | - REPORT_TYPE_AUTH_FAILURES | REPORT_TYPE_SITE_USER_TIME_DATE | REPORT_TYPE_DOWNLOADS; + REPORT_TYPE_SITES_USERS | REPORT_TYPE_DATE_TIME | REPORT_TYPE_DENIED | + REPORT_TYPE_AUTH_FAILURES | REPORT_TYPE_SITE_USER_TIME_DATE | REPORT_TYPE_DOWNLOADS; } if(access(ExcludeUsers, R_OK) == 0) { @@ -750,7 +748,7 @@ int main(int argc,char *argv[]) #warning "No rlimit resource for the number of open files" #endif if(rc == -1) { - debuga(_("setrlimit error - %s\n"),strerror(errno)); + debuga(_("setrlimit error - %s\n"),strerror(errno)); } if(debug) @@ -883,11 +881,11 @@ int main(int argc,char *argv[]) recs2++; if( ShowReadStatistics && !from_stdin && !from_pipe && --OutputNonZero<=0) { - double perc = recs2 * 100. / recs1 ; - printf(_("SARG: Records in file: %lu, reading: %3.2lf%%"),recs2,perc); - putchar('\r'); - fflush (stdout); - OutputNonZero = REPORT_EVERY_X_LINES ; + double perc = recs2 * 100. / recs1 ; + printf(_("SARG: Records in file: %lu, reading: %3.2lf%%"),recs2,perc); + putchar('\r'); + fflush (stdout); + OutputNonZero = REPORT_EVERY_X_LINES ; } if(blen < 58) continue; if(strstr(linebuf,"HTTP/0.0") != 0) continue; @@ -909,7 +907,7 @@ int main(int argc,char *argv[]) } } if(!exstring && (str=(char *) strstr(linebuf,gwarea.current)) != (char *) NULL ) - exstring=true; + exstring=true; if(exstring) continue; } @@ -939,7 +937,7 @@ int main(int argc,char *argv[]) } } if (getword(data,sizeof(data),&gwarea,']')<0 || getword_skip(MAXLEN,&gwarea,'"')<0 || - getword(fun,sizeof(fun),&gwarea,' ')<0) { + getword(fun,sizeof(fun),&gwarea,' ')<0) { debuga(_("Maybe you have a broken record or garbage in your %s file\n"),arq); exit(EXIT_FAILURE); } @@ -1242,12 +1240,10 @@ int main(int argc,char *argv[]) // Record only hours usage which is required if (t) { - if( bsearch( &( t -> tm_wday ), weekdays.list, weekdays.len, - sizeof( int ), compar ) == NULL ) + if( bsearch( &( t -> tm_wday ), weekdays.list, weekdays.len, sizeof( int ), compar ) == NULL ) continue; - if( bsearch( &( t -> tm_hour ), hours.list, hours.len, - sizeof( int ), compar ) == NULL ) + if( bsearch( &( t -> tm_hour ), hours.list, hours.len, sizeof( int ), compar ) == NULL ) continue; } @@ -1551,7 +1547,7 @@ int main(int argc,char *argv[]) longline_destroy(&line); if ( fp_Download_Unsort ) - fclose (fp_Download_Unsort); + fclose (fp_Download_Unsort); for (ufile=first_user_file ; ufile ; ufile=ufile1) { ufile1=ufile->next; @@ -1616,7 +1612,6 @@ int main(int argc,char *argv[]) if(debug) debuga(_("Period: %s\n"),period.text); -// fclose(fp_ou); if(fp_denied) fclose(fp_denied); if(fp_authfail) diff --git a/repday.c b/repday.c index c22e79e..0f7d400 100644 --- a/repday.c +++ b/repday.c @@ -66,8 +66,8 @@ void report_day(const struct userinfostruct *uinfo) } if((fp_in=fopen(wdirname,"r"))==NULL) { - debuga(_("(repday) Cannot open log file %s\n"),wdirname); - exit(EXIT_FAILURE); + debuga(_("(repday) Cannot open log file %s\n"),wdirname); + exit(EXIT_FAILURE); } memset(tbytes,0,sizeof(tbytes)); @@ -119,8 +119,8 @@ void report_day(const struct userinfostruct *uinfo) fclose(fp_in); if((fp_ou=fopen(arqout,"w"))==NULL) { - debuga(_("(repday) Cannot open log file %s\n"),arqout); - exit(EXIT_FAILURE); + debuga(_("(repday) Cannot open log file %s\n"),arqout); + exit(EXIT_FAILURE); } write_html_header(fp_ou,(IndexTree == INDEX_TREE_DATE) ? 4 : 2,_("Day report"),HTML_JS_NONE); diff --git a/report.c b/report.c index 499c75c..4e8e57b 100644 --- a/report.c +++ b/report.c @@ -112,9 +112,9 @@ void gerarel(void) dlen=strlen(direntp->d_name)-(sizeof(logext)-1); if (dlen<0) continue; if((strcmp(direntp->d_name+dlen,logext) != 0) || - (strncmp(direntp->d_name,"download.log",12) == 0) || - (strncmp(direntp->d_name,"denied.log",10) == 0) || - (strncmp(direntp->d_name,"authfail.log.unsort",19) == 0)) + (strncmp(direntp->d_name,"download.log",12) == 0) || + (strncmp(direntp->d_name,"denied.log",10) == 0) || + (strncmp(direntp->d_name,"authfail.log.unsort",19) == 0)) continue; if (snprintf(tmp3,sizeof(tmp3),"%s/%s",tmp,direntp->d_name)>=sizeof(tmp3)) { debuga(_("(report) directory entry too long: %s/%s\n"),tmp,direntp->d_name); @@ -165,9 +165,9 @@ void gerarel(void) while((buf=longline_read(fp_in,line))!=NULL) { getword_start(&gwarea,buf); if (getword(accdia,sizeof(accdia),&gwarea,'\t')<0 || getword(acchora,sizeof(acchora),&gwarea,'\t')<0 || - getword(accip,sizeof(accip),&gwarea,'\t')<0 || - getword_ptr(buf,&accurl,&gwarea,'\t')<0 || getword_atoll(&accbytes,&gwarea,'\t')<0 || - getword(acccode,sizeof(acccode),&gwarea,'\t')<0) { + getword(accip,sizeof(accip),&gwarea,'\t')<0 || + getword_ptr(buf,&accurl,&gwarea,'\t')<0 || getword_atoll(&accbytes,&gwarea,'\t')<0 || + getword(acccode,sizeof(acccode),&gwarea,'\t')<0) { debuga(_("There is a broken record or garbage in file %s\n"),tmp3); exit(EXIT_FAILURE); } @@ -255,7 +255,7 @@ void gerarel(void) nelap+=accelap; if ((ReportType & REPORT_TYPE_SITE_USER_TIME_DATE) != 0 && - (!oldurltt || strcmp(oldurltt,accurl) || strcmp(oldaccdiatt,accdia) || strcmp(oldacchoratt,acchora))) { + (!oldurltt || strcmp(oldurltt,accurl) || strcmp(oldaccdiatt,accdia) || strcmp(oldacchoratt,acchora))) { if(!ttopen) { snprintf(arqtt,sizeof(arqtt),"%s/%s",outdirname,uinfo->filename); @@ -271,8 +271,7 @@ void gerarel(void) /* if(Privacy) - sprintf(httplink,"%s", \ - FontSize,PrivacyStringColor,PrivacyString,PrivacyString); + sprintf(httplink,"%s",FontSize,PrivacyStringColor,PrivacyString,PrivacyString); else sprintf(httplink,"%s",FontSize,accurl,accurl); */ diff --git a/siteuser.c b/siteuser.c index d38f4c9..a22f14f 100644 --- a/siteuser.c +++ b/siteuser.c @@ -68,14 +68,14 @@ void siteuser(void) } if((fp_in=fopen(general2,"r"))==NULL) { - debuga(_("(siteuser) Cannot open log file %s\n"),general2); - debuga(_("sort command: %s\n"),csort); - exit(EXIT_FAILURE); + debuga(_("(siteuser) Cannot open log file %s\n"),general2); + debuga(_("sort command: %s\n"),csort); + exit(EXIT_FAILURE); } if((fp_ou=fopen(report,"w"))==NULL) { - debuga(_("(siteuser) Cannot open log file %s\n"),report); - exit(EXIT_FAILURE); + debuga(_("(siteuser) Cannot open log file %s\n"),report); + exit(EXIT_FAILURE); } write_html_header(fp_ou,(IndexTree == INDEX_TREE_DATE) ? 3 : 1,_("Sites & Users"),HTML_JS_SORTTABLE); diff --git a/smartfilter.c b/smartfilter.c index aa6d5a2..a34b797 100644 --- a/smartfilter.c +++ b/smartfilter.c @@ -80,8 +80,8 @@ void smartfilter_report(void) unlink(smart_in); if((fp_ou=fopen(report,"w"))==NULL) { - debuga(_("(smartfilter) Cannot open log file %s\n"),report); - exit(EXIT_FAILURE); + debuga(_("(smartfilter) Cannot open log file %s\n"),report); + exit(EXIT_FAILURE); } fprintf(fp_ou, "\n\n\n \n",CharSet); @@ -107,8 +107,8 @@ void smartfilter_report(void) while(fgets(buf,sizeof(buf),fp_in)!=NULL) { getword_start(&gwarea,buf); if (getword(user,sizeof(user),&gwarea,'\t')<0 || getword(data,sizeof(data),&gwarea,'\t')<0 || - getword(hora,sizeof(hora),&gwarea,'\t')<0 || getword(ip,sizeof(ip),&gwarea,'\t')<0 || - getword(url,sizeof(url),&gwarea,'\t')<0 || getword(smartcat,sizeof(smartcat),&gwarea,'\n')<0) { + getword(hora,sizeof(hora),&gwarea,'\t')<0 || getword(ip,sizeof(ip),&gwarea,'\t')<0 || + getword(url,sizeof(url),&gwarea,'\t')<0 || getword(smartcat,sizeof(smartcat),&gwarea,'\n')<0) { debuga(_("There is a broken record or garbage in file %s\n"),smart_ou); exit(EXIT_FAILURE); } diff --git a/sort.c b/sort.c index 083c450..3fad666 100644 --- a/sort.c +++ b/sort.c @@ -145,10 +145,10 @@ void sort_users_log(const char *tmp, int debug) if(strcmp(direntp->d_name,"download.unsort") == 0) clen=snprintf(csort,sizeof(csort),"sort -T \"%s\" -k 3,3 -k 1,1 -k 2,2 -k 5,5 -o \"%s/%s.log\" \"%s/%s.unsort\"", - tmp, tmp, user, tmp, user); + tmp, tmp, user, tmp, user); else clen=snprintf(csort,sizeof(csort),"sort -T \"%s\" -k 4,4 -k 1,1 -k 2,2 -o \"%s/%s.log\" \"%s/%s.unsort\"", - tmp, tmp, user, tmp, user); + tmp, tmp, user, tmp, user); if (clen>=sizeof(csort)) { debuga(_("user name too long to sort %s\n"),csort); exit(EXIT_FAILURE); diff --git a/squidguard_log.c b/squidguard_log.c index 0c75879..8d88512 100644 --- a/squidguard_log.c +++ b/squidguard_log.c @@ -174,7 +174,7 @@ static void read_log(const char *wentp, FILE *fp_ou,int dfrom,int duntil) } } else { if (getword_atoll(&lyear,&gwarea,'-')<0 || getword_atoll(&lmon,&gwarea,'-')<0 || - getword_atoll(&lday,&gwarea,' ')<0) { + getword_atoll(&lday,&gwarea,' ')<0) { debuga(_("Invalid date found in file %s\n"),wentp); exit(EXIT_FAILURE); } @@ -288,7 +288,7 @@ void squidguard_log(void) str2 = user; if(SquidGuardConf[0] == '\0' && NRedirectorLogs == 0) - return; + return; sprintf(guard_in,"%s/redirector.unsort",tmp); sprintf(guard_ou,"%s/redirector.log",tmp); diff --git a/squidguard_report.c b/squidguard_report.c index c00d3d4..8f3dc7e 100644 --- a/squidguard_report.c +++ b/squidguard_report.c @@ -65,13 +65,13 @@ void squidguard_report(void) snprintf(report,sizeof(report),"%s/redirector.html",outdirname); if((fp_in=fopen(squidguard_in,"r"))==NULL) { - debuga(_("(squidguard) Cannot open log file %s\n"),squidguard_in); - exit(EXIT_FAILURE); + debuga(_("(squidguard) Cannot open log file %s\n"),squidguard_in); + exit(EXIT_FAILURE); } if((fp_ou=fopen(report,"w"))==NULL) { - debuga(_("(squidguard) Cannot open log file %s\n"),report); - exit(EXIT_FAILURE); + debuga(_("(squidguard) Cannot open log file %s\n"),report); + exit(EXIT_FAILURE); } if ((line=longline_create())==NULL) { diff --git a/topsites.c b/topsites.c index eca6745..744cbd7 100644 --- a/topsites.c +++ b/topsites.c @@ -79,14 +79,14 @@ void topsites(void) } if((fp_in=fopen(general2,"r"))==NULL) { - debuga(_("(topsites) Cannot open log file %s\n"),general2); - debuga(_("sort command: %s\n"),csort); - exit(EXIT_FAILURE); + debuga(_("(topsites) Cannot open log file %s\n"),general2); + debuga(_("sort command: %s\n"),csort); + exit(EXIT_FAILURE); } if((fp_ou=fopen(general3,"w"))==NULL) { - debuga(_("(topsites) Cannot open log file %s\n"),general3); - exit(EXIT_FAILURE); + debuga(_("(topsites) Cannot open log file %s\n"),general3); + exit(EXIT_FAILURE); } if ((line=longline_create())==NULL) { @@ -184,8 +184,8 @@ void topsites(void) unlink(general3); if((fp_ou=fopen(report,"w"))==NULL) { - debuga(_("(topsites) Cannot open log file %s\n"),report); - exit(EXIT_FAILURE); + debuga(_("(topsites) Cannot open log file %s\n"),report); + exit(EXIT_FAILURE); } write_html_header(fp_ou,(IndexTree == INDEX_TREE_DATE) ? 3 : 1,_("Top sites"),HTML_JS_SORTTABLE); diff --git a/totday.c b/totday.c index bf6ddf5..b095b4b 100644 --- a/totday.c +++ b/totday.c @@ -110,8 +110,8 @@ void day_totalize(const char *tmp, const struct userinfostruct *uinfo, int index fclose(fp_in); if((fp_ou=fopen(arqout,"w"))==NULL) { - debuga(_("(totday) Cannot open log file %s\n"),arqout); - exit(EXIT_FAILURE); + debuga(_("(totday) Cannot open log file %s\n"),arqout); + exit(EXIT_FAILURE); } for (i=0 ; i0) ? limit-1 : 0]='\0'; #if USE_GETWORD_BACKTRACE - getword_backtrace(); + getword_backtrace(); #endif return(-1); } @@ -841,8 +819,8 @@ int getperiod_buildtext(struct periodstruct *period) if (i == 0) return(-1); range=(period->start.tm_year!=period->end.tm_year || - period->start.tm_mon!=period->end.tm_mon || - period->start.tm_mday!=period->end.tm_mday); + period->start.tm_mon!=period->end.tm_mon || + period->start.tm_mday!=period->end.tm_mday); if (range) { if(df[0]=='u') { i=strftime(text2, sizeof(text2)-i, "%Y %b %d", &period->end); @@ -963,10 +941,10 @@ int vrfydir(const struct periodstruct *per1, const char *addr, const char *site, } else { if(df[0] == 'u') { wlen=snprintf(wdir+wlen,sizeof(wdir)-wlen,"%04d%s%02d-%04d%s%02d",y1, - conv_month_name(m1),d1,y2,conv_month_name(m2),d2); + conv_month_name(m1),d1,y2,conv_month_name(m2),d2); } else if(df[0] == 'e') { wlen=snprintf(wdir+wlen,sizeof(wdir)-wlen,"%02d%s%04d-%02d%s%04d",d1, - conv_month_name(m1),y1,d2,conv_month_name(m2),y2); + conv_month_name(m1),y1,d2,conv_month_name(m2),y2); } else if(df[0] == 'w') { wlen2=strftime(wdir+wlen, sizeof(wdir)-wlen, "%Y.%U", &per1->start); if (wlen2==0) return(-1); @@ -1752,7 +1730,7 @@ void unlinkdir(const char *dir,int contentonly) if (!dirp) return; while ((direntp = readdir(dirp)) != NULL) { if (direntp->d_name[0] == '.' && (direntp->d_name[1] == '\0' || - (direntp->d_name[1] == '.' && direntp->d_name[2] == '\0'))) + (direntp->d_name[1] == '.' && direntp->d_name[2] == '\0'))) continue; if (snprintf(dname,sizeof(dname),"%s/%s",dir,direntp->d_name)>=sizeof(dname)) { debuga(_("directory name to delete too long: %s/%s\n"),dir,direntp->d_name); -- 2.47.2