]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Fix problem in parsing of the header of an ISA log
authorFrédéric Marchal <fmarchal@users.sourceforge.net>
Tue, 2 Mar 2010 13:49:32 +0000 (13:49 +0000)
committerFrédéric Marchal <fmarchal@users.sourceforge.net>
Tue, 2 Mar 2010 13:49:32 +0000 (13:49 +0000)
log.c

diff --git a/log.c b/log.c
index 2ae767672ec4b109eb519c50e6149b5b3f48c3c6..ce68b528f2b186be7ed218595cd181be4c6ba421 100644 (file)
--- a/log.c
+++ b/log.c
@@ -862,12 +862,12 @@ int main(int argc,char *argv[])
             continue;
 
          // exclude_string
-         exstring=0;
          if(ExcludeString[0] != '\0') {
+            exstring=0;
             getword_start(&gwarea,ExcludeString);
             while(strchr(gwarea.current,':') != 0) {
                if (getword_multisep(val1,sizeof(val1),&gwarea,':')<0) {
-                  printf("SARG: Maybe you have a broken record or garbage in your exclusion string.\n");
+                  debuga(_("Maybe you have a broken record or garbage in your exclusion string"));
                   exit(1);
                }
                if((str=(char *) strstr(linebuf,val1)) != (char *) NULL )
@@ -875,8 +875,8 @@ int main(int argc,char *argv[])
             }
             if((str=(char *) strstr(linebuf,gwarea.current)) != (char *) NULL )
                   exstring++;
+            if(exstring) continue;
          }
-         if(exstring) continue;
 
          totregsl++;
          if(debugm)
@@ -1026,7 +1026,7 @@ int main(int argc,char *argv[])
                getword_start(&gwarea,linebuf);
                // remove the #Fields: column at the beginning of the line
                if (getword_skip(1000,&gwarea,' ')<0){
-                  printf("SARG: Maybe you have a broken record or garbage in your %s file.\n",arq);
+                  debuga(_("Maybe you have a broken record or garbage in your %s file"),arq);
                   exit(1);
                }
                for (ncols=0 ; ncols<ISACOL_Last ; ncols++) cols[ncols]=-1;
@@ -1048,8 +1048,8 @@ int main(int argc,char *argv[])
                }
                if (cols[ISACOL_Ip]>=0) {
                   isa_ncols=ncols;
-                  for (isa_ncols=0 ; isa_ncols<ncols ; isa_ncols++)
-                     isa_cols[isa_ncols]=cols[isa_ncols];
+                  for (ncols=0 ; ncols<ISACOL_Last ; ncols++)
+                     isa_cols[ncols]=cols[ncols];
                }
                continue;
             }