From: Frédéric Marchal Date: Sun, 26 Aug 2012 15:25:49 +0000 (+0200) Subject: Accept common log files without extension column X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2c46b12f971df006ab8cb99e5cdf33ba58ab19d7;p=thirdparty%2Fsarg.git Accept common log files without extension column The sample common log file used to test the program contained additional columns. The standard common log format doesn't have those column. Sarg failed to parse the standard format due to the lack of any supernumerary column. --- diff --git a/readlog_common.c b/readlog_common.c index af85312..6c8917a 100644 --- a/readlog_common.c +++ b/readlog_common.c @@ -162,8 +162,9 @@ static enum ReadLogReturnCodeEnum Common_ReadEntry(char *Line,struct ReadLogStru Begin=++Line; Entry->DataSize=0LL; while (isdigit(*Line)) Entry->DataSize=Entry->DataSize*10+(*Line++-'0'); - if (*Line!=' ' || Begin==Line) return(RLRC_Unknown); - + // some log contains more columns + if ((*Line && *Line!=' ') || Begin==Line) return(RLRC_Unknown); + // check the entry time if (mktime(&Entry->EntryTime)==-1) { debuga(_("Invalid date or time found in the common log file\n"));