From c7851516b0dec1989f34a8c95234a69f76f879e4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Marchal?= Date: Mon, 9 Jul 2012 20:09:41 +0200 Subject: [PATCH] Output getword error messages on stderr 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 | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/util.c b/util.c index cd4adb0..f1996e9 100644 --- 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 -- 2.47.2