]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Apply a few more recommandation from splint
authorFrédéric Marchal <fmarchal@users.sourceforge.net>
Thu, 18 Mar 2010 14:41:25 +0000 (14:41 +0000)
committerFrédéric Marchal <fmarchal@users.sourceforge.net>
Thu, 18 Mar 2010 14:41:25 +0000 (14:41 +0000)
35 files changed:
CMakeLists.txt
configure.in
documentation/exclude.txt
download.c
email.c
exclude.c
getconf.c
include/conf.h
include/config.h.in
include/defs.h
log.c
po/bg.po
po/ca.po
po/cs.po
po/de.po
po/el.po
po/es.po
po/fr.po
po/hu.po
po/id.po
po/it.po
po/ja.po
po/lv.po
po/nl.po
po/pl.po
po/pt.po
po/ro.po
po/ru.po
po/sk.po
po/sr.po
po/tr.po
po/uk.po
report.c
splintrc
util.c

index 775ca6fe36dac8eadd0b567a3b610d6ead62e6df..d350d2d3fd497e32099139fab073af349a3be31b 100755 (executable)
@@ -131,10 +131,10 @@ IF(HAVE_GD_H)
    CHECK_INCLUDE_FILE(gdfontg.h HAVE_GDFONTG_H)
    FIND_LIBRARY(GD_LIBRARY NAMES gd bgd DOC "The GD library")
    IF(GD_LIBRARY)
-      #CHECK_LIBRARY_EXISTS(gd gdImagePng "." HAVE_GD)
+      #CHECK_LIBRARY_EXISTS(gd gdImagePng "." HAVE_GD_LIB)
       TARGET_LINK_LIBRARIES(sarg ${GD_LIBRARY})
-      SET(HAVE_GD GD_LIBRARY CACHE PATH DOC "True IF GD was found")
-      SET(HAVE_GD CACHE BOOL DOC "True IF must use GD")
+      SET(HAVE_GD_LIB GD_LIBRARY CACHE PATH DOC "True IF GD was found")
+      SET(HAVE_GD_LIB CACHE BOOL DOC "True IF must use GD")
    ENDIF(GD_LIBRARY)
 ENDIF(HAVE_GD_H)
 
index 6a0c239e9edd0db9b2b948be55f01cccac5cf337..6cc0625e39deb3d2a8914efc9703f311fd3097fb 100644 (file)
@@ -77,7 +77,7 @@ AC_CHECK_HEADERS(stdio.h stdlib.h string.h strings.h sys/time.h time.h unistd.h
                errno.h sys/resource.h sys/wait.h stdarg.h inttypes.h limits.h locale.h \
                execinfo.h ldap.h math.h libintl.h libgen.h stdbool.h)
 
-AC_CHECK_LIB(gd, gdImagePng,LIBS="-lgd ${LIBS}"; HAVE_GD="yes", HAVE_GD="")
+AC_CHECK_LIB(gd, gdImagePng,LIBS="-lgd ${LIBS}"; HAVE_GD_LIB="yes", HAVE_GD_LIB="")
 AC_CHECK_LIB(ldap, ldap_init,LIBS="-lldap ${LIBS}"; HAVE_LDAP="yes", HAVE_LDAP="")
 
 dnl Checks for typedefs, structures, and compiler characteristics.
index 8374da3d63d992bf5c570876c9f563851354caa1..2645c3862440e9e3d2baea9c0a4e9fbc45133610 100644 (file)
@@ -85,7 +85,7 @@ Tell if the user is excluded from the report.
 
 
 
-/*! \fn int is_indexonly(void)
+/*! \fn bool is_indexonly(void)
 Tell if the exclusion list of the users mention the word "indexonly" meaning that
 the user only want to produce the index.html.
 
index 2e379dfbdc532bece64603f1f41a424f53bf41e8..9660d25cf866a8b0492982c58429a438ca23229c 100644 (file)
@@ -27,8 +27,8 @@
 #include "include/conf.h"
 #include "include/defs.h"
 
-static char *DownloadSuffix=NULL;
-static char **DownloadSuffixIndex=NULL;
+/*@null@*/static char *DownloadSuffix=NULL;
+/*@null@*/static char **DownloadSuffixIndex=NULL;
 static int NDownloadSuffix=0;
 
 void download_report(void)
@@ -52,7 +52,7 @@ void download_report(void)
    int  z=0;
    int  count=0;
    int i;
-   int new_user;
+   bool new_user;
    struct getwordstruct gwarea;
    longline line;
    struct userinfostruct *uinfo;
@@ -60,16 +60,14 @@ void download_report(void)
    ouser[0]='\0';
    ouser2[0]='\0';
 
-   sprintf(report_in,"%s/sarg/download.log",TempDir);
+   snprintf(report_in,sizeof(report_in),"%s/sarg/download.log",TempDir);
    if(access(report_in, R_OK) != 0)
       return;
 
-   strcpy(wdirname,outdirname);
-   sprintf(report,"%s/download.html",wdirname);
-   strcat(wdirname,"/");
-   strcat(wdirname,"sarg-period");
+   snprintf(report,sizeof(report),"%s/download.html",outdirname);
+   snprintf(wdirname,sizeof(wdirname),"%s/sarg-period",outdirname);
 
-   if ((fp_in = fopen(wdirname, "r")) == 0) {
+   if ((fp_in = fopen(wdirname, "r")) == NULL) {
       debuga(_("(download) Cannot open file %s\n"),wdirname);
       exit(EXIT_FAILURE);
    }
@@ -121,20 +119,20 @@ void download_report(void)
          debuga(_("Unknown user ID %s in file %s\n"),user,report_in);
          exit(EXIT_FAILURE);
       }
-      new_user=0;
+      new_user=false;
       if(!z) {
          strcpy(ouser,user);
          strcpy(oip,ip);
          z++;
-         new_user=1;
+         new_user=true;
       } else {
          if(strcmp(ouser,user) != 0) {
             strcpy(ouser,user);
-            new_user=1;
+            new_user=true;
          }
          if(strcmp(oip,ip) != 0) {
             strcpy(oip,ip);
-            new_user=1;
+            new_user=true;
          }
       }
 
@@ -245,7 +243,7 @@ void set_download_suffix(const char *list)
    }
 }
 
-int is_download_suffix(const char *url)
+bool is_download_suffix(const char *url)
 {
    int urllen;
    int i;
@@ -254,17 +252,17 @@ int is_download_suffix(const char *url)
    int cmp;
    const int max_suffix=10;
 
-   if (DownloadSuffix == NULL || NDownloadSuffix == 0) return(0);
+   if (DownloadSuffix == NULL || NDownloadSuffix == 0) return(false);
 
    urllen=strlen(url)-1;
-   if (urllen<=0) return(0);
-   if (url[urllen] == '.') return(0); //reject a single trailing dot
+   if (urllen<=0) return(false);
+   if (url[urllen] == '.') return(false); //reject a single trailing dot
    for (i=0 ; i<urllen && (url[i]!='/' || url[i+1]=='/') && url[i]!='?' ; i++);
-   if (i>=urllen) return(0); // url is a hostname without any path or file to download
+   if (i>=urllen) return(false); // url is a hostname without any path or file to download
 
    for (i=0 ; i<=max_suffix && i<urllen && url[urllen-i]!='.' ; i++)
-      if (url[urllen-i] == '/' || url[urllen-i] == '?') return(0);
-   if (i>max_suffix || i>=urllen) return(0);
+      if (url[urllen-i] == '/' || url[urllen-i] == '?') return(false);
+   if (i>max_suffix || i>=urllen) return(false);
 
    suffix=url+urllen-i+1;
    down=0;
@@ -272,12 +270,12 @@ int is_download_suffix(const char *url)
    while (down<=up) {
       center=(down+up)/2;
       cmp=strcasecmp(suffix,DownloadSuffixIndex[center]);
-      if (cmp == 0) return(1);
+      if (cmp == 0) return(true);
       if (cmp < 0)
          up = center-1;
       else
          down = center+1;
    }
-   return(0);
+   return(false);
 }
 
diff --git a/email.c b/email.c
index c9c37d8c72ae21695912addbb04a0d524ae6d602..b9d42c558aab9de21e703cb3ed6dc6c34f035938 100644 (file)
--- a/email.c
+++ b/email.c
@@ -27,7 +27,7 @@
 #include "include/conf.h"
 #include "include/defs.h"
 
-int geramail(const char *dirname, int debug, const char *outdir, int userip, const char *email, const char *TempDir)
+int geramail(const char *dirname, int debug, const char *outdir, const char *email, const char *TempDir)
 {
 
    FILE *fp_in, *fp_top1, *fp_top2, *fp_top3;
index 2b3602e90eff3f8890c795d9605d7547999a629a..b50fbbfa6cfbb3881ce13c374573f755d03b4a05 100644 (file)
--- a/exclude.c
+++ b/exclude.c
@@ -375,9 +375,9 @@ int vuexclude(const char *user)
    return(1);
 }
 
-int is_indexonly(void)
+bool is_indexonly(void)
 {
-   if (excludeuser==NULL) return(0);
+   if (excludeuser==NULL) return(false);
    return(strstr(excludeuser,"indexonly") != NULL);
 }
 
index 06783667504566d8ccefb2099184126c707502d8..a2f9e089cdd12f2dc43dda471f4c8e0dc1894ac3 100644 (file)
--- a/getconf.c
+++ b/getconf.c
@@ -597,7 +597,7 @@ static void parmtest(char *buf)
    if (getparam_string("graph_font",buf,GraphFont,sizeof(GraphFont))>0) return;
 
    if(strstr(buf,"squid24") != 0) {
-      squid24++;
+      squid24=true;
       return;
    }
 
index 683ee88caefe3558b77743631cad93403d907c2c..b1fca217c367308f4857d6785fbef12d9ec7e9df 100755 (executable)
@@ -63,6 +63,7 @@
 #include <sys/wait.h>
 #endif
 #ifdef HAVE_GD_H
+#define HAVE_GD 1
 #include <gd.h>
 gdImagePtr im;
 gdPoint points[4];
@@ -340,8 +341,6 @@ unsigned long int NtlmUserFormat;
 unsigned long int IndexTree;
 bool UserAuthentication;
 char AuthUserTemplateFile[1024];
-char *str;
-char *str2;
 char val1[MAXLEN];
 char val2[MAXLEN];
 char val3[MAXLEN];
@@ -368,7 +367,6 @@ char Ulimit[6];
 char RealtimeTypes[1024];
 char cmd[255];
 char ImageFile[255];
-char tbuf[128];
 char RealtimeUnauthRec[15];
 char LDAPHost[255];
 char LDAPBindDN[512];
@@ -400,8 +398,8 @@ int  dfrom;
 int  duntil;
 int  dataonly;
 int  indexonly;
-int  iprel;
-int  userip;
+bool  iprel;
+bool  userip;
 int  langcode;
 int  debug;
 int  debugz;
@@ -415,15 +413,13 @@ int  SquidGuardReportLimit;
 int  UserReportLimit;
 int  realtime_refresh;
 int  realtime_access_log_lines;
-int  realt;
 int  rc;
 int  ntopsites;
 int  nsitesusers;
 int  nrepday;
 int  ndownload;
 int  ntopuser;
-int  squid24;
-float perc;
+bool  squid24;
 
 long long int nocost;
 float cost;
index d8b132d0bcb1e1d873bd52f35410529a5354c847..7c7264bf32ed2d2335eb825cada6b57ecf33cf0c 100644 (file)
@@ -24,7 +24,6 @@
 #cmakedefine HAVE_NETINET_H
 #cmakedefine HAVE_SYS_STAT_H
 #cmakedefine HAVE_CTYPE_H
-#cmakedefine HAVE_GD
 #cmakedefine HAVE_GD_H
 #cmakedefine HAVE_GDFONTL_H
 #cmakedefine HAVE_GDFONTT_H
index b0246d264d162b9e6bce91cb6257ad26705417ba..d9ec4a43c5e9dd182bb4378831cddb6a760e854b 100755 (executable)
@@ -84,17 +84,17 @@ void gen_denied_report(void);
 void download_report(void);
 void free_download(void);
 void set_download_suffix(const char *list);
-int is_download_suffix(const char *url);
+bool is_download_suffix(const char *url);
 
 // email.c
-int geramail(const char *dirname, int debug, const char *outdir, int userip, const char *email, const char *TempDir);
+int geramail(const char *dirname, int debug, const char *outdir, const char *email, const char *TempDir);
 
 // exclude.c
 void gethexclude(const char *hexfile, int debug);
 void getuexclude(const char *uexfile, int debug);
 int vhexclude(const char *url);
 int vuexclude(const char *user);
-int is_indexonly(void);
+bool is_indexonly(void);
 void free_exclude(void);
 
 // getconf.c
diff --git a/log.c b/log.c
index d439a1d429d705f95f550e644f4fc89b881ec612..c7c4810c10e6832236b9af0ebd5fac584d74e692 100644 (file)
--- a/log.c
+++ b/log.c
@@ -37,7 +37,7 @@ struct userfilestruct
    FILE *file;
 };
 
-static char *userfile=NULL;
+/*@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,
@@ -121,15 +121,14 @@ int main(int argc,char *argv[])
    int  x;
    int  errflg=0;
    int  puser=0;
-   int  fhost=0;
-   int  dns=0;
-   int  fuser=0;
+   bool  fhost=false;
+   bool  dns=false;
+   bool  fuser=false;
    int  idata=0;
    int  mindate=0;
    int  iarq=0;
-   int  exstring=0;
    int isa_ncols=0,isa_cols[ISACOL_Last];
-   int from_stdin;
+   bool from_stdin;
    int blen;
    int maxopenfiles;
    int nopen;
@@ -139,12 +138,13 @@ int main(int argc,char *argv[])
    long totregsx=0;
    long totper=0;
    long int max_elapsed=0;
+   bool realt;
    time_t tt;
    struct tm *t;
    unsigned long recs1=0UL;
    unsigned long recs2=0UL;
    int OutputNonZero = REPORT_EVERY_X_LINES ;
-   int download_flag=0;
+   bool download_flag=false;
    char *download_url=NULL;
    struct getwordstruct gwarea;
    longline line;
@@ -197,8 +197,8 @@ int main(int argc,char *argv[])
    strcpy(OutputDir,"/var/www/html/squid-reports");
    Ip2Name=0;
    strcpy(DateFormat,"u");
-   OverwriteReport=0;
-   RemoveTempFiles=1;
+   OverwriteReport=false;
+   RemoveTempFiles=true;
    strcpy(ReplaceIndex,"index.html");
    Index=INDEX_YES;
    RecordsWithoutUser=RECORDWITHOUTUSER_IP;
@@ -220,7 +220,7 @@ int main(int argc,char *argv[])
    Privacy=0;
    strcpy(PrivacyString,"***.***.***.***");
    strcpy(PrivacyStringColor,"blue");
-   SuccessfulMsg=1;
+   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 |
@@ -231,10 +231,10 @@ int main(int argc,char *argv[])
    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;
-   ShowReadStatistics=1;
+   ShowReadStatistics=true;
    strcpy(IndexSortOrder,"D");
-   ShowSargInfo=1;
-   ShowSargLogo=1;
+   ShowSargInfo=true;
+   ShowSargLogo=true;
    strcpy(ParsedOutputLog,"no");
    strcpy(ParsedOutputLogCompress,"/bin/gzip -f");
    strcpy(DisplayedValues,"abbreviation");
@@ -242,7 +242,7 @@ int main(int argc,char *argv[])
    strcpy(TitleFontSize,"11px");
    strcpy(AuthUserTemplateFile,"sarg_htaccess");
    set_download_suffix("7z,ace,arj,avi,bat,bin,bz2,bzip,cab,com,cpio,dll,doc,dot,exe,gz,iso,lha,lzh,mdb,mov,mp3,mpeg,mpg,mso,nrg,ogg,ppt,rar,rtf,shs,src,sys,tar,tgz,vcd,vob,wma,wmv,zip");
-   Graphs=1;
+   Graphs=true;
 #if defined(FONTDIR)
    strcpy(GraphFont,FONTDIR"/DejaVuSans.ttf");
 #else
@@ -312,18 +312,18 @@ int main(int argc,char *argv[])
    debug=0;
    debugz=0;
    debugm=0;
-   iprel=0;
-   userip=0;
+   iprel=false;
+   userip=false;
    color1=0;
    color2=0;
    color3=0;
-   realt=0;
+   realt=false;
    realtime_refresh=3;
    realtime_access_log_lines=1000;
    cost=0.01;
    nocost=50000000;
    ndownload=0;
-   squid24=0;
+   squid24=false;
 
    bzero(IncludeUsers, sizeof(IncludeUsers));
    bzero(ExcludeString, sizeof(ExcludeString));
@@ -352,7 +352,7 @@ int main(int argc,char *argv[])
             strncpy(date,optarg,sizeof(date)-1);
             date[sizeof(date)-1]='\0';
             getword_start(&gwarea,optarg);
-            if (getword(cdfrom,sizeof(cdfrom),&gwarea,'-')<0 || getword(cduntil,sizeof(cduntil),&gwarea,0)<0) {
+            if (getword(cdfrom,sizeof(cdfrom),&gwarea,'-')<0 || getword(cduntil,sizeof(cduntil),&gwarea,'\0')<0) {
                printf(_("SARG: The date range requested on the command line by option -d is invalid.\n"));
                exit(EXIT_FAILURE);
             }
@@ -371,10 +371,9 @@ int main(int argc,char *argv[])
             break;
          case 'h':
             usage(argv[0]);
-            exit(0);
-            break;
+            exit(EXIT_SUCCESS);
          case 'i':
-            iprel++;
+            iprel=true;
             break;
          case 'l':
             if (NAccessLog>=MAXLOGS) {
@@ -392,16 +391,16 @@ int main(int argc,char *argv[])
             debugm++;
             break;
          case 'n':
-            dns++;
+            dns=true;
             break;
          case 'o':
             strcpy(outdir,optarg);
             break;
          case 'p':
-            userip++;
+            userip=true;
             break;
          case 'r':
-            realt++;
+            realt=true;
             break;
          case 's':
             strcpy(site,optarg);
@@ -415,7 +414,7 @@ int main(int argc,char *argv[])
               strcpy(hmf,optarg);
             } else {
                getword_start(&gwarea,optarg);
-               if (getword(hm,sizeof(hm),&gwarea,'-')<0 || getword(hmf,sizeof(hmf),&gwarea,0)<0) {
+               if (getword(hm,sizeof(hm),&gwarea,'-')<0 || getword(hmf,sizeof(hmf),&gwarea,'\0')<0) {
                   debuga(_("The time range passed on the command line with option -t is invalid\n"));
                   exit(EXIT_FAILURE);
                }
@@ -457,19 +456,18 @@ int main(int argc,char *argv[])
          case '?':
             usage(argv[0]);
             exit(EXIT_FAILURE);
-            break;
       }
 
    }
 
-   if (errflg) {
+   if (errflg>0) {
       usage(argv[0]);
       exit(2);
    }
 
    if(debug) debuga(_("Init\n"));
 
-   if(ConfigFile[0] == '\0') sprintf(ConfigFile,"%s/sarg.conf",SYSCONFDIR);
+   if(ConfigFile[0] == '\0') snprintf(ConfigFile,sizeof(ConfigFile),"%s/sarg.conf",SYSCONFDIR);
    if(access(ConfigFile, R_OK) != 0) {
       debuga(_("Cannot open config file: %s - %s\n"),ConfigFile,strerror(errno));
       exit(EXIT_FAILURE);
@@ -478,13 +476,13 @@ int main(int argc,char *argv[])
    if(access(ConfigFile, R_OK) == 0)
       getconf();
 
-   if(UserIp) userip++;
+   if(UserIp) userip=true;
 
-   if(dns) Ip2Name=1;
+   if(dns) Ip2Name=true;
 
    if(realt) {
       realtime();
-      exit(0);
+      exit(EXIT_SUCCESS);
    }
 
    if(IndexTree == INDEX_TREE_FILE)
@@ -496,19 +494,19 @@ int main(int argc,char *argv[])
    if(DataFile[0] != '\0')
       dataonly++;
 
-   if(!NAccessLog) {
+   if(NAccessLog == 0) {
       strcpy(AccessLog[0],"/var/log/squid/access.log");
       NAccessLog++;
    }
 
    if(strcmp(hexclude,"onvert") == 0 && strcmp(site,"plit") != 0) {
       convlog(AccessLog[0], df, dfrom, duntil);
-      exit(0);
+      exit(EXIT_SUCCESS);
    }
 
    if(strcmp(site,"plit") == 0) {
       splitlog(AccessLog[0], df, dfrom, duntil, hexclude);
-      exit(0);
+      exit(EXIT_SUCCESS);
    }
 
    load_excludecodes(ExcludeCodes);
@@ -522,7 +520,7 @@ int main(int argc,char *argv[])
       strcpy(hexclude,ExcludeHosts);
    if(hexclude[0] != '\0') {
       gethexclude(hexclude,debug);
-      fhost++;
+      fhost=true;
    }
 
    if(ReportType == 0) {
@@ -533,7 +531,7 @@ int main(int argc,char *argv[])
 
    if(access(ExcludeUsers, R_OK) == 0) {
       getuexclude(ExcludeUsers,debug);
-      fuser++;
+      fuser=true;
    }
 
    indexonly=0;
@@ -567,7 +565,7 @@ int main(int argc,char *argv[])
    strcpy(tmp2,tmp);
 
    if(email[0] != '\0') {
-      sprintf(wtemp2,"%s/sarg",tmp2);
+      snprintf(wtemp2,sizeof(wtemp2),"%s/sarg",tmp2);
       my_mkdir(wtemp2);
       strcat(tmp2,"/sarg");
       strcpy(outdir,tmp2);
@@ -691,7 +689,7 @@ int main(int argc,char *argv[])
       exit(EXIT_FAILURE);
    }
 
-   sprintf ( sz_Download_Unsort , "%s/sarg/download.unsort", tmp);
+   snprintf(sz_Download_Unsort,sizeof(sz_Download_Unsort),"%s/sarg/download.unsort", tmp);
 
    if(DataFile[0]=='\0') {
       if((ReportType & REPORT_TYPE_DENIED) != 0) {
@@ -718,7 +716,7 @@ int main(int argc,char *argv[])
          if(debug)
             debuga(_("Reading access log file: from stdin\n"));
          fp_in=stdin;
-         from_stdin=1;
+         from_stdin=true;
       } else {
          decomp(arq,zip,tmp);
          if(debug)
@@ -727,14 +725,14 @@ int main(int argc,char *argv[])
             debuga(_("(log) Cannot open log file: %s - %s\n"),arq,strerror(errno));
             exit(EXIT_FAILURE);
          }
-         from_stdin=0;
+         from_stdin=false;
       }
       ilf=ILF_Unknown;
-      download_flag=0;
+      download_flag=false;
       // pre-read the file only if we have to show stats
       if(ShowReadStatistics && !from_stdin) {
          size_t nread,i;
-         int skipcr=0;
+         bool skipcr=false;
          char tmp4[MAXLEN];
 
          recs1=0UL;
@@ -744,11 +742,11 @@ int main(int argc,char *argv[])
             for (i=0 ; i<nread ; i++)
                if (skipcr) {
                   if (tmp4[i]!='\n' && tmp4[i]!='\r') {
-                     skipcr=0;
+                     skipcr=false;
                   }
                } else {
                   if (tmp4[i]=='\n' || tmp4[i]=='\r') {
-                     skipcr=1;
+                     skipcr=true;
                      recs1++;
                   }
                }
@@ -801,10 +799,9 @@ int main(int argc,char *argv[])
          }
 
          recs2++;
-         if( ShowReadStatistics && !from_stdin && ! --OutputNonZero) {
-           perc = recs2 * 100 ;
-           perc = perc / recs1 ;
-           printf(_("SARG: Records in file: %lu, reading: %3.2f%%"),recs1,perc);
+         if( ShowReadStatistics && !from_stdin && --OutputNonZero<=0) {
+           double perc = recs2 * 100. / recs1 ;
+           printf(_("SARG: Records in file: %lu, reading: %3.2lf%%"),recs1,perc);
            putchar('\r');
            fflush (stdout);
            OutputNonZero = REPORT_EVERY_X_LINES ;
@@ -816,18 +813,20 @@ int main(int argc,char *argv[])
 
          // exclude_string
          if(ExcludeString[0] != '\0') {
-            exstring=0;
+            bool exstring=false;
             getword_start(&gwarea,ExcludeString);
             while(strchr(gwarea.current,':') != 0) {
                if (getword_multisep(val1,sizeof(val1),&gwarea,':')<0) {
                   debuga(_("Maybe you have a broken record or garbage in your exclusion string\n"));
                   exit(EXIT_FAILURE);
                }
-               if((str=(char *) strstr(linebuf,val1)) != (char *) NULL )
-                  exstring++;
+               if((str=(char *) strstr(linebuf,val1)) != (char *) NULL ) {
+                  exstring=true;
+                  break;
+               }
             }
-            if((str=(char *) strstr(linebuf,gwarea.current)) != (char *) NULL )
-                  exstring++;
+            if(!exstring && (str=(char *) strstr(linebuf,gwarea.current)) != (char *) NULL )
+                  exstring=true;
             if(exstring) continue;
          }
 
@@ -865,8 +864,15 @@ int main(int argc,char *argv[])
                      debuga(_("Maybe you have a broken url in your %s file\n"),arq);
                      exit(EXIT_FAILURE);
                   }
-                  if (getword_skip(MAXLEN,&gwarea,' ')<0 || getword(code2,sizeof(code2),&gwarea,' ')<0 ||
-                      getword(tam,sizeof(tam),&gwarea,' ')<0) {
+                  if (getword_skip(MAXLEN,&gwarea,' ')<0) {
+                     debuga(_("Maybe you have a broken record or garbage in your %s file\n"),arq);
+                     exit(EXIT_FAILURE);
+                  }
+                  if (getword(code2,sizeof(code2),&gwarea,' ')<0) {
+                     debuga(_("Maybe you have a broken record or garbage in your %s file\n"),arq);
+                     exit(EXIT_FAILURE);
+                  }
+                  if (getword(tam,sizeof(tam),&gwarea,' ')<0) {
                      debuga(_("Maybe you have a broken record or garbage in your %s file\n"),arq);
                      exit(EXIT_FAILURE);
                   }
@@ -1158,7 +1164,7 @@ int main(int argc,char *argv[])
                   exit(EXIT_FAILURE);
                }
             }
-            if (getword(ano,sizeof(ano),&gwarea,0)<0){
+            if (getword(ano,sizeof(ano),&gwarea,'\0')<0){
                debuga(_("Maybe you have a broken date in your %s file\n"),arq);
                exit(EXIT_FAILURE);
             }
@@ -1250,7 +1256,7 @@ int main(int argc,char *argv[])
                download_count++;
             }
          } else
-            download_flag=0;
+            download_flag=false;
 
          // remove any protocol:// at the beginning of the URL
          if ((str = strchr(url,'/')) != NULL && str[1] == '/') {
@@ -1534,7 +1540,7 @@ int main(int argc,char *argv[])
          unlink(denied_unsort);
          unlink(authfail_unsort);
          unlink(tmp3);
-         exit(0);
+         exit(EXIT_SUCCESS);
       }
    }
 
@@ -1550,7 +1556,7 @@ int main(int argc,char *argv[])
       if(userfile)
          free(userfile);
       close_usertab();
-      exit(0);
+      exit(EXIT_SUCCESS);
    }
 
    if(date[0] == '\0' && ilf_count[ILF_Sarg]==0) {
@@ -1647,7 +1653,7 @@ int main(int argc,char *argv[])
    if(debug)
       debuga(_("End\n"));
 
-   exit(0);
+   exit(EXIT_SUCCESS);
 
 }
 
@@ -1691,7 +1697,7 @@ static void getusers(const char *pwdfile, int debug)
          debuga(_("You have an invalid user in your %s file\n"),pwdfile);
          exit(EXIT_FAILURE);
       }
-      str[1]=0;
+      str[1]='\0';
       strcat(userfile,buf);
    }
 
index 07897da360734b4f88134ba3a27bd0881297139f..4e8a0994dade10870bb3be5d8bd631892a52192a 100644 (file)
--- a/po/bg.po
+++ b/po/bg.po
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: sarg 2.3\n"
 "Report-Msgid-Bugs-To: fmarchal@users.sourceforge.net\n"
-"POT-Creation-Date: 2010-03-17 20:20+0100\n"
+"POT-Creation-Date: 2010-03-18 08:36+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index be0dc6b785163137df595c548c92974d3bd09b17..1d78e5624adf2658194f891e26e887f9c4d5a44c 100644 (file)
--- a/po/ca.po
+++ b/po/ca.po
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: sarg 2.3\n"
 "Report-Msgid-Bugs-To: fmarchal@users.sourceforge.net\n"
-"POT-Creation-Date: 2010-03-17 20:20+0100\n"
+"POT-Creation-Date: 2010-03-18 08:36+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index dd5ec30121a4c0444cfca3f15db74d44b75899ae..5f130e73639a48297ed73981637db5d8c6d090c1 100644 (file)
--- a/po/cs.po
+++ b/po/cs.po
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: sarg 2.3\n"
 "Report-Msgid-Bugs-To: fmarchal@users.sourceforge.net\n"
-"POT-Creation-Date: 2010-03-17 20:20+0100\n"
+"POT-Creation-Date: 2010-03-18 08:36+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index 445231df987b2ef281722c75e4f87885d9cee1d2..79028006c1e21a4f53179fb364c2d2deb3300ed8 100644 (file)
--- a/po/de.po
+++ b/po/de.po
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: sarg 2.3\n"
 "Report-Msgid-Bugs-To: fmarchal@users.sourceforge.net\n"
-"POT-Creation-Date: 2010-03-17 20:20+0100\n"
+"POT-Creation-Date: 2010-03-18 08:36+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index fbce2b179090388dcacb3b6e3ba19901c163e9d3..60db0b74332a3b047a9e346c380bf716e3952d21 100644 (file)
--- a/po/el.po
+++ b/po/el.po
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: sarg 2.3\n"
 "Report-Msgid-Bugs-To: fmarchal@users.sourceforge.net\n"
-"POT-Creation-Date: 2010-03-17 20:20+0100\n"
+"POT-Creation-Date: 2010-03-18 08:36+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index fd5b5d8f75c03567806a6d4e76b4864d1f41e382..569f553d3d84e6e84f0efa051362cafebbfdfb81 100644 (file)
--- a/po/es.po
+++ b/po/es.po
@@ -9,7 +9,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: sarg 2.3\n"
 "Report-Msgid-Bugs-To: fmarchal@users.sourceforge.net\n"
-"POT-Creation-Date: 2010-03-17 20:20+0100\n"
+"POT-Creation-Date: 2010-03-18 08:36+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index 190c89379e1377fe47ec2c2ff223ca0adff1418f..e59c83a99b32872d76995747f127302220556ff8 100644 (file)
--- a/po/fr.po
+++ b/po/fr.po
@@ -9,7 +9,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: fr\n"
 "Report-Msgid-Bugs-To: fmarchal@users.sourceforge.net\n"
-"POT-Creation-Date: 2010-03-17 20:20+0100\n"
+"POT-Creation-Date: 2010-03-18 08:36+0100\n"
 "PO-Revision-Date: 2010-03-17 20:22+0100\n"
 "Last-Translator: Frédéric Marchal <fmarchal@perso.be>\n"
 "Language-Team: French <traduc@traduc.org>\n"
@@ -531,7 +531,8 @@ msgstr "Valeur «%s» inconnue pour le paramètre «%s»\n"
 
 #: getconf.c:301
 #, c-format
-msgid "Value \"%s\" conflicts with other selected values for parameter \"%s\"\n"
+msgid ""
+"Value \"%s\" conflicts with other selected values for parameter \"%s\"\n"
 msgstr ""
 "La valeur «%s» entre en conflit avec les autres valeurs sélectionnées pour le "
 "paramètre «%s»\n"
@@ -543,7 +544,8 @@ msgstr "SARG: OPTION: %s\n"
 
 #: getconf.c:368
 #, c-format
-msgid "Maybe you have a broken record or garbage in \"date_format\" parameter\n"
+msgid ""
+"Maybe you have a broken record or garbage in \"date_format\" parameter\n"
 msgstr ""
 "Vous avez probablement un enregistrement erroné ou inattendu dans le "
 "paramètre «date_format»\n"
@@ -1422,7 +1424,8 @@ msgstr "erreur d'allocation mémoire (%ld)\n"
 #: log.c:1691
 #, c-format
 msgid "You have an invalid user in your %s file\n"
-msgstr "Vous avez probablement un utilisateur incorrect dans votre fichier %s\n"
+msgstr ""
+"Vous avez probablement un utilisateur incorrect dans votre fichier %s\n"
 
 #: longline.c:109 longline.c:122
 #, c-format
@@ -1983,7 +1986,8 @@ msgstr "     -d Date de-à jj/mm/aaaa-jj/mm/aaaa"
 
 #: usage.c:37
 msgid "     -e Email address to send reports (stdout for console)"
-msgstr "     -e Adresse e-mail où envoyer les rapports (stdout pour la console)"
+msgstr ""
+"     -e Adresse e-mail où envoyer les rapports (stdout pour la console)"
 
 #: usage.c:38
 #, c-format
@@ -2176,7 +2180,8 @@ msgstr "Tampon inacceptable passé à getword_ptr\n"
 #: util.c:294
 #, c-format
 msgid "Invalid path (%s). Please, use absolute paths only.\n"
-msgstr "Chemin erroné (%s). Veuillez utiliser des chemins absolus uniquement.\n"
+msgstr ""
+"Chemin erroné (%s). Veuillez utiliser des chemins absolus uniquement.\n"
 
 #: util.c:295 util.c:310 util.c:322
 #, c-format
index c62a360c5b6640f1ce0de584c457ba073ba43005..e359c47da5a793e7326dc5de9ed472c257c8d919 100644 (file)
--- a/po/hu.po
+++ b/po/hu.po
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: sarg 2.3\n"
 "Report-Msgid-Bugs-To: fmarchal@users.sourceforge.net\n"
-"POT-Creation-Date: 2010-03-17 20:20+0100\n"
+"POT-Creation-Date: 2010-03-18 08:36+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index 4e48e4224fb4be6cbf90456da0ce519112e86976..a8b34662f48e752052d5c1a776c3f0b2557a0985 100644 (file)
--- a/po/id.po
+++ b/po/id.po
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: sarg 2.3\n"
 "Report-Msgid-Bugs-To: fmarchal@users.sourceforge.net\n"
-"POT-Creation-Date: 2010-03-17 20:20+0100\n"
+"POT-Creation-Date: 2010-03-18 08:36+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index 37e8b5d0674ec748ee12cace3052daefbaae9542..8faca709d453ea88f432e32278f961f1e50326b6 100644 (file)
--- a/po/it.po
+++ b/po/it.po
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: sarg 2.3\n"
 "Report-Msgid-Bugs-To: fmarchal@users.sourceforge.net\n"
-"POT-Creation-Date: 2010-03-17 20:20+0100\n"
+"POT-Creation-Date: 2010-03-18 08:36+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index 28199c37a1a3e27ec7508e66fa0c2b30810fcd54..852b503a84fd2fd10a1045d613c2193901cfd492 100644 (file)
--- a/po/ja.po
+++ b/po/ja.po
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: sarg 2.3\n"
 "Report-Msgid-Bugs-To: fmarchal@users.sourceforge.net\n"
-"POT-Creation-Date: 2010-03-17 20:20+0100\n"
+"POT-Creation-Date: 2010-03-18 08:36+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index 2788db9409b5d9dfb570d68374387c25e4729866..73b41b8f58f2d97f6b27c1452faae4f06b00c124 100644 (file)
--- a/po/lv.po
+++ b/po/lv.po
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: sarg 2.3\n"
 "Report-Msgid-Bugs-To: fmarchal@users.sourceforge.net\n"
-"POT-Creation-Date: 2010-03-17 20:20+0100\n"
+"POT-Creation-Date: 2010-03-18 08:36+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index 136fad8b6aed28e98067d11723e37cd34fc5a8ad..24ac3a4d00c9ee7446d07bf8cd55c1920293afc3 100644 (file)
--- a/po/nl.po
+++ b/po/nl.po
@@ -10,7 +10,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: sarg 2.3\n"
 "Report-Msgid-Bugs-To: fmarchal@users.sourceforge.net\n"
-"POT-Creation-Date: 2010-03-17 20:20+0100\n"
+"POT-Creation-Date: 2010-03-18 08:36+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index 330ebc27c2a85f91e0167b63a91d702674f4ede9..8e2d6015294a0d884b3f5932582aa184d13a46a7 100644 (file)
--- a/po/pl.po
+++ b/po/pl.po
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: sarg 2.3\n"
 "Report-Msgid-Bugs-To: fmarchal@users.sourceforge.net\n"
-"POT-Creation-Date: 2010-03-17 20:20+0100\n"
+"POT-Creation-Date: 2010-03-18 08:36+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index 521ae66ecc1a7fcc80d7a06047e879306acf0244..7771dbbcdaeef99e552be0275963b6bed79b4b40 100644 (file)
--- a/po/pt.po
+++ b/po/pt.po
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: sarg 2.3\n"
 "Report-Msgid-Bugs-To: fmarchal@users.sourceforge.net\n"
-"POT-Creation-Date: 2010-03-17 20:20+0100\n"
+"POT-Creation-Date: 2010-03-18 08:36+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index 60e69bb345c34853ac5dcd445eed2a3ddfb6eb43..3972151ab645a23ed97fffab9f780bfc8b30ce8a 100644 (file)
--- a/po/ro.po
+++ b/po/ro.po
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: sarg 2.3\n"
 "Report-Msgid-Bugs-To: fmarchal@users.sourceforge.net\n"
-"POT-Creation-Date: 2010-03-17 20:20+0100\n"
+"POT-Creation-Date: 2010-03-18 08:36+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index 5e101e91dc8a42a8d8edab296bb53358af176512..3f8ffc9c96c7dc7c21c76fca4191f3358ee181cc 100644 (file)
--- a/po/ru.po
+++ b/po/ru.po
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: sarg 2.3\n"
 "Report-Msgid-Bugs-To: fmarchal@users.sourceforge.net\n"
-"POT-Creation-Date: 2010-03-17 20:20+0100\n"
+"POT-Creation-Date: 2010-03-18 08:36+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index 78332c64b79a09502d5df0182d6166a1937f6cae..c85acbc3338c70b23f3fe2613b71c0cf4d4443de 100644 (file)
--- a/po/sk.po
+++ b/po/sk.po
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: sarg 2.3\n"
 "Report-Msgid-Bugs-To: fmarchal@users.sourceforge.net\n"
-"POT-Creation-Date: 2010-03-17 20:20+0100\n"
+"POT-Creation-Date: 2010-03-18 08:36+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index dea18186caedb2ca641c4835eeb4f9d312d34404..cf5a46fc3021d18cde0b6d32f478b87414819607 100644 (file)
--- a/po/sr.po
+++ b/po/sr.po
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: sarg 2.3\n"
 "Report-Msgid-Bugs-To: fmarchal@users.sourceforge.net\n"
-"POT-Creation-Date: 2010-03-17 20:20+0100\n"
+"POT-Creation-Date: 2010-03-18 08:36+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index d61764f510b1074c54e8c5ce46c05adf5440d629..0be162a1b89dcd924622d3c3ab604117d9d7683f 100644 (file)
--- a/po/tr.po
+++ b/po/tr.po
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: sarg 2.3\n"
 "Report-Msgid-Bugs-To: fmarchal@users.sourceforge.net\n"
-"POT-Creation-Date: 2010-03-17 20:20+0100\n"
+"POT-Creation-Date: 2010-03-18 08:36+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index 8fabf58de6d81e21eb036960a7e0a7e9728d2579..087a04da0d2f3b03e04018c9186f23d69a045441 100644 (file)
--- a/po/uk.po
+++ b/po/uk.po
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: sarg 2.3\n"
 "Report-Msgid-Bugs-To: fmarchal@users.sourceforge.net\n"
-"POT-Creation-Date: 2010-03-17 20:20+0100\n"
+"POT-Creation-Date: 2010-03-18 08:36+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index c76cb84e559e2ea1745cd294429cf3ecef5f1850..903b42f8e6a8288570171720c1212edacdb2e67c 100644 (file)
--- a/report.c
+++ b/report.c
@@ -388,7 +388,7 @@ void gerarel(void)
 
       if(SuccessfulMsg) debuga(_("Successful report generated on %s\n"),outdirname);
     } else {
-      geramail(outdirname, debug, outdir, userip, email, TempDir);
+      geramail(outdirname, debug, outdir, email, TempDir);
 
       if((strcmp(email,"stdout") != 0) && SuccessfulMsg)
          debuga(_("Successful report generated and sent to %s\n"),email);
index 151099f8d18bd8ccad0f872f4fac6369ab738d1a..9b19d3816ea25c2f2824ea64cd543cd95b8a8bef 100644 (file)
--- a/splintrc
+++ b/splintrc
@@ -1,6 +1,11 @@
 +posixlib
 -retvalint
+-retvalother
 +matchanyintegral
+-formatconst
+-initallelements
+-nestedextern
++ignoresigns
 
 -I .
 
@@ -25,7 +30,6 @@
 -DHAVE_NETINET_H=1
 -DHAVE_SYS_STAT_H=1
 -DHAVE_CTYPE_H=1
--DHAVE_GD=1
 -DHAVE_GD_H=1
 -DHAVE_GDFONTL_H=1
 -DHAVE_GDFONTT_H=1
diff --git a/util.c b/util.c
index c3ebc64574cd5d2d3254c279bd33840f67a9ffa8..42c7f96ec17f1b80e48e64dc3d4021425adeacfb 100644 (file)
--- a/util.c
+++ b/util.c
@@ -1598,7 +1598,7 @@ void url_to_file(const char *url,char *file,int filesize)
 void version(void)
 {
    printf(_("SARG Version: %s\n"),VERSION);
-   exit(0);
+   exit(EXIT_SUCCESS);
 }
 
 char *get_param_value(const char *param,char *line)