From: Frédéric Marchal Date: Wed, 1 Feb 2012 19:47:37 +0000 (+0100) Subject: Cleanup the use of a supernumerary url variable X-Git-Tag: v2.3.3-pre1~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12c63fb457a35bbb20caac34ac6bd308234c55af;p=thirdparty%2Fsarg.git Cleanup the use of a supernumerary url variable Two redundant pointers were making the code more confusing. --- diff --git a/log.c b/log.c index dd40024..dda4dbe 100644 --- a/log.c +++ b/log.c @@ -108,7 +108,6 @@ int main(int argc,char *argv[]) char *linebuf; const char *url; char *full_url; - char *urly; char user[MAX_USER_LEN]; char splitprefix[MAXLEN]; enum InputLogFormat ilf; @@ -1325,8 +1324,6 @@ int main(int argc,char *argv[]) for (str=code ; *str ; str++) if (*str=='\t') *str=' '; - urly=full_url; - if(ilf!=ILF_Sarg) { /* The full URL is not saved in sarg log. There is no point in testing the URL to detect @@ -1520,13 +1517,13 @@ int main(int argc,char *argv[]) if((ReportType & REPORT_TYPE_DENIED) != 0) { if(fp_denied && strstr(code,"DENIED/403") != 0) { - fprintf(fp_denied, "%s\t%s\t%s\t%s\t%s\n",dia,hora,user,ip,urly); + fprintf(fp_denied, "%s\t%s\t%s\t%s\t%s\n",dia,hora,user,ip,full_url); denied_count++; } } if((ReportType & REPORT_TYPE_AUTH_FAILURES) != 0) { if(fp_authfail && (strstr(code,"DENIED/401") != 0 || strstr(code,"DENIED/407") != 0)) { - fprintf(fp_authfail, "%s\t%s\t%s\t%s\t%s\n",dia,hora,user,ip,urly); + fprintf(fp_authfail, "%s\t%s\t%s\t%s\t%s\n",dia,hora,user,ip,full_url); authfail_count++; } }