]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Cleanup the use of a supernumerary url variable
authorFrédéric Marchal <fmarchal@users.sourceforge.net>
Wed, 1 Feb 2012 19:47:37 +0000 (20:47 +0100)
committerFrédéric Marchal <fmarchal@users.sourceforge.net>
Wed, 1 Feb 2012 19:47:37 +0000 (20:47 +0100)
Two redundant pointers were making the code more confusing.

log.c

diff --git a/log.c b/log.c
index dd40024bd343dc8ac0a5aa4426a32fa1d43c07ad..dda4dbea4f1a725b6d6c0ee78e6c754f70e0be5e 100644 (file)
--- 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++;
                                }
                        }