return(0);
}
+int getword_atol(long int *number, struct getwordstruct *gwarea, char stop)
+{
+ long int x;
+ long int sign=+1;
+ int digit;
+
+ if (gwarea->current[0] == '-') {
+ gwarea->current++;
+ sign=-1;
+ } else if (gwarea->current[0] == '+') {
+ gwarea->current++;
+ }
+ *number=0;
+ for(x=0;isdigit(gwarea->current[x]);x++) {
+ digit=gwarea->current[x]-'0';
+ if (*number > (LONG_MAX-digit)/10) {
+ debuga(_("Integer overflow detected in getword_atol in line %s\n"),gwarea->beginning);
+ return(-1);
+ }
+ *number=(*number * 10) + digit;
+ }
+ if(gwarea->current[x] && gwarea->current[x]!=stop) {
+ 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
+ return(-1);
+ }
+ *number*=sign;
+
+ if (gwarea->current[x]) ++x;
+ gwarea->current+=x;
+ return(0);
+}
+
+int getword_atolu(unsigned long int *number, struct getwordstruct *gwarea, char stop)
+{
+ unsigned long int x;
+ int digit;
+
+ if (gwarea->current[0] == '-') {
+ 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] == '+') {
+ gwarea->current++;
+ }
+ *number=0;
+ for(x=0;isdigit(gwarea->current[x]);x++) {
+ digit=gwarea->current[x]-'0';
+ if (*number > (ULONG_MAX-digit)/10) {
+ debuga(_("Integer overflow detected in getword_atolu in line %s\n"),gwarea->beginning);
+ return(-1);
+ }
+ *number=(*number * 10) + digit;
+ }
+ if(gwarea->current[x] && gwarea->current[x]!=stop) {
+ 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
+ return(-1);
+ }
+
+ if (gwarea->current[x]) ++x;
+ gwarea->current+=x;
+ return(0);
+}
+
int getword_ptr(char *orig_line,char **word, struct getwordstruct *gwarea, char stop)
{