]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Output getword error messages on stderr
authorFrédéric Marchal <fmarchal@users.sourceforge.net>
Mon, 9 Jul 2012 18:09:41 +0000 (20:09 +0200)
committerFrédéric Marchal <fmarchal@users.sourceforge.net>
Mon, 9 Jul 2012 18:09:41 +0000 (20:09 +0200)
That change was first made on branch v2.3 and merged with v2.4. The new
functions introduced in version 2.4 have been changed to reflect the same
change.

util.c

diff --git a/util.c b/util.c
index cd4adb0238b0824141d1ab2715892f4148493989..f1996e92745a9a99a8310664af6d12055a080ebb 100644 (file)
--- a/util.c
+++ b/util.c
@@ -268,11 +268,11 @@ int getword_atol(long int *number, struct getwordstruct *gwarea, char stop)
                *number=(*number * 10) + digit;
        }
        if(gwarea->current[x] && gwarea->current[x]!=stop) {
-               printf("SARG: getword_atol loop detected after %ld bytes.\n",x);
-               printf("SARG: Line=\"%s\"\n",gwarea->beginning);
-               printf("SARG: Record=\"%s\"\n",gwarea->current);
-               printf("SARG: searching for \'x%x\'\n",stop);
-               //printf("SARG: Maybe you have a broken record or garbage in your access.log file.\n");
+               debuga(_("getword_atol loop detected after %ld bytes.\n"),x);
+               debuga(_("Line=\"%s\"\n"),gwarea->beginning);
+               debuga(_("Record=\"%s\"\n"),gwarea->current);
+               debuga(_("searching for \'x%x\'\n"),stop);
+               //debuga(_("Maybe you have a broken record or garbage in your access.log file.\n"));
 #if USE_GETWORD_BACKTRACE
                getword_backtrace();
 #endif
@@ -291,9 +291,9 @@ int getword_atolu(unsigned long int *number, struct getwordstruct *gwarea, char
        int digit;
 
        if (gwarea->current[0] == '-') {
-               printf("SARG: getword_atolu got a negative number.\n");
-               printf("SARG: Line=\"%s\"\n",gwarea->beginning);
-               printf("SARG: Record=\"%s\"\n",gwarea->current);
+               debuga(_("getword_atolu got a negative number.\n"));
+               debuga(_("Line=\"%s\"\n"),gwarea->beginning);
+               debuga(_("Record=\"%s\"\n"),gwarea->current);
                return(-1);
        }
        if (gwarea->current[0] == '+') {
@@ -309,11 +309,11 @@ int getword_atolu(unsigned long int *number, struct getwordstruct *gwarea, char
                *number=(*number * 10) + digit;
        }
        if(gwarea->current[x] && gwarea->current[x]!=stop) {
-               printf("SARG: getword_atolu loop detected after %ld bytes.\n",x);
-               printf("SARG: Line=\"%s\"\n",gwarea->beginning);
-               printf("SARG: Record=\"%s\"\n",gwarea->current);
-               printf("SARG: searching for \'x%x\'\n",stop);
-               //printf("SARG: Maybe you have a broken record or garbage in your access.log file.\n");
+               debuga(_("getword_atolu loop detected after %ld bytes.\n"),x);
+               debuga(_("Line=\"%s\"\n"),gwarea->beginning);
+               debuga(_("Record=\"%s\"\n"),gwarea->current);
+               debuga(_("searching for \'x%x\'\n"),stop);
+               //debuga(_("Maybe you have a broken record or garbage in your access.log file.\n"));
 #if USE_GETWORD_BACKTRACE
                getword_backtrace();
 #endif