]> git.ipfire.org Git - thirdparty/sarg.git/blobdiff - log.c
Remove all the warnings (inspired from patch #1771501).
[thirdparty/sarg.git] / log.c
diff --git a/log.c b/log.c
index beb8bbfc3fcc9544e52e2894a7f838d283d7a838..7c0b0c0ad2d5d84a47e341298d8fc9f8dde9cbf0 100644 (file)
--- a/log.c
+++ b/log.c
@@ -54,7 +54,7 @@ int main(argc,argv)
    char *argv[];
 {
 
-   FILE *fp_in = NULL, *fp_ou = NULL, *fp_denied, *fp_usr, *fp_authfail, *fp_log;
+   FILE *fp_in = NULL, *fp_ou = NULL, *fp_denied=NULL, *fp_usr, *fp_authfail=NULL, *fp_log=NULL;
 
    char sz_Download_Unsort[ 20000 ] ;
    FILE * fp_Download_Unsort = NULL ;
@@ -679,7 +679,7 @@ int main(argc,argv)
       }
 
       if(debug) {
-         sprintf(msg,"Maximum file descriptor: cur=%ld max=%ld, changed to cur=%ld max=%ld",l1,l2,rl.rlim_cur,rl.rlim_max);
+         sprintf(msg,"Maximum file descriptor: cur=%ld max=%ld, changed to cur="RLIM_STRING" max="RLIM_STRING,l1,l2,rl.rlim_cur,rl.rlim_max);
          debuga(msg);
       }
    }
@@ -739,7 +739,7 @@ int main(argc,argv)
    }
 
 #if defined(HAVE_FOPEN64)
-   if((fp_in=(long)fopen64(arq,"r"))==NULL) {
+   if((fp_in=fopen64(arq,"r"))==NULL) {
 #else
    if((fp_in=fopen(arq,"r"))==NULL) {
 #endif
@@ -766,7 +766,7 @@ int main(argc,argv)
       }
       sprintf(arq_log,"%s/sarg_temp.log",ParsedOutputLog);
 #if defined(HAVE_FOPEN64)
-      if((fp_log=(long)fopen64(arq_log,"w"))==NULL) {
+      if((fp_log=fopen64(arq_log,"w"))==NULL) {
 #else
       if((fp_log=fopen(arq_log,"w"))==NULL) {
 #endif
@@ -778,7 +778,7 @@ int main(argc,argv)
 
    if(strstr(ReportType,"denied") != 0) {
 #if defined(HAVE_FOPEN64)
-      if((fp_denied=(long)fopen64(tmp4,"w"))==NULL) {
+      if((fp_denied=fopen64(tmp4,"w"))==NULL) {
 #else
       if((fp_denied=fopen(tmp4,"w"))==NULL) {
 #endif
@@ -790,7 +790,7 @@ int main(argc,argv)
    if(DataFile[0]=='\0') {
       if(strstr(ReportType,"denied") != 0 || strstr(ReportType,"auth_failures") != 0) {
 #if defined(HAVE_FOPEN64)
-         if((fp_authfail=(long)fopen64(tmp6,"w"))==NULL) {
+         if((fp_authfail=fopen64(tmp6,"w"))==NULL) {
 #else
          if((fp_authfail=fopen(tmp6,"w"))==NULL) {
 #endif
@@ -1412,7 +1412,7 @@ int main(argc,argv)
 
               if(download_flag && strstr(code,"DENIED") == 0) {
                  ndownload = 1;
-                 sprintf(bufz, "%s %s %s %s %s %s\n",dia,hora,user,ip,download_url);
+                 sprintf(bufz, "%s %s %s %s %s\n",dia,hora,user,ip,download_url);
 
 #ifdef LEGACY_WRITE_DOWNLOAD
                  sprintf(tmp3,"%s/sarg/download.unsort",tmp);
@@ -1520,10 +1520,8 @@ int main(argc,argv)
             fclose(fp_denied);
          if(fp_authfail)
             fclose(fp_authfail);
-         if(tmp4)
-            unlink(tmp4);
-         if(tmp6)
-            unlink(tmp6);
+         unlink(tmp4);
+         unlink(tmp6);
          unlink(tmp3);
          exit(0);
       }
@@ -1608,7 +1606,6 @@ int main(argc,argv)
  
    sort_users_log(tmp, debug);
 
-   report_gen:
    if(strlen(DataFile) > 0)
       data_file(tmp);
    else