From: Frédéric Marchal Date: Sun, 26 Aug 2012 13:39:53 +0000 (+0200) Subject: Editor removed trailing spaces X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0c87646f39e20d7b37f091bb99ca5b86c6086de0;p=thirdparty%2Fsarg.git Editor removed trailing spaces No change in the program. Only those files are affected. Other files may get changed in the future. --- diff --git a/readlog.c b/readlog.c index fcd5171..1543de4 100644 --- a/readlog.c +++ b/readlog.c @@ -145,7 +145,7 @@ int ReadLogFile(struct ReadLogDataStruct *Filter) debuga(_("Not enough memory to read a log file\n")); exit(EXIT_FAILURE); } - + for (iarq=0 ; iarqReadEntry(linebuf,&log_entry); } - + // find out what line format to use if (log_entry_status==RLRC_Unknown) { x=-1; @@ -808,7 +808,7 @@ int ReadLogFile(struct ReadLogDataStruct *Filter) continue; if (log_entry.DataSize<0) log_entry.DataSize=0; - + if (log_entry.ElapsedTime<0) log_entry.ElapsedTime=0; if (Filter->max_elapsed>0 && log_entry.ElapsedTime>Filter->max_elapsed) { log_entry.ElapsedTime=0; @@ -955,7 +955,7 @@ int ReadLogFile(struct ReadLogDataStruct *Filter) char end_hour[128]; char val2[40]; char val4[255];//val4 must not be bigger than arq_log without fixing the strcpy below - + fclose(fp_log); safe_strcpy(end_hour,tbuf2,sizeof(end_hour)); strftime(val2,sizeof(val2),"%d%m%Y",&period.start); @@ -988,7 +988,7 @@ int ReadLogFile(struct ReadLogDataStruct *Filter) } if(debug) debuga(_("Sarg parsed log saved as %s\n"),arq_log); - } + } denied_close(); authfail_close(); diff --git a/readlog_sarg.c b/readlog_sarg.c index b00dfe8..ed93dfc 100644 --- a/readlog_sarg.c +++ b/readlog_sarg.c @@ -61,13 +61,13 @@ static enum ReadLogReturnCodeEnum Sarg_ReadEntry(char *Line,struct ReadLogStruct int Hour; int Minute; int Second; - + if (strncmp(Line,"*** SARG Log ***",16)==0) { InSargLog=true; return(RLRC_Ignore); } if (!InSargLog) return(RLRC_Unknown); - + // get the date Day=0; while (isdigit(*Line)) Day=Day*10+(*Line++-'0'); @@ -83,7 +83,7 @@ static enum ReadLogReturnCodeEnum Sarg_ReadEntry(char *Line,struct ReadLogStruct Year=0; while (isdigit(*Line)) Year=Year*10+(*Line++-'0'); if (*Line!='\t' || Year<1900 || Year>2200) return(RLRC_Unknown); - + // get the time ++Line; Hour=0; @@ -110,7 +110,7 @@ static enum ReadLogReturnCodeEnum Sarg_ReadEntry(char *Line,struct ReadLogStruct Entry->User=++Line; for (UserLen=0 ; *Line && *Line!='\t' ; UserLen++) Line++; if (*Line!='\t' || UserLen==0) return(RLRC_Unknown); - + // get IP address Entry->Ip=++Line; for (IpLen=0 ; *Line && *Line!='\t' ; IpLen++) Line++; @@ -120,13 +120,13 @@ static enum ReadLogReturnCodeEnum Sarg_ReadEntry(char *Line,struct ReadLogStruct Entry->Url=++Line; for (UrlLen=0 ; *Line && *Line!='\t' ; UrlLen++) Line++; if (*Line!='\t' || UrlLen==0) return(RLRC_Unknown); - + // get the number of transfered bytes. Begin=++Line; Entry->DataSize=0LL; while (isdigit(*Line)) Entry->DataSize=Entry->DataSize*10+(*Line++-'0'); if (*Line!='\t' || Begin==Line) return(RLRC_Unknown); - + // get the HTTP code. Entry->HttpCode=++Line; for (HttpCodeLen=0 ; *Line && *Line!='\t' ; HttpCodeLen++) Line++; @@ -152,7 +152,7 @@ static enum ReadLogReturnCodeEnum Sarg_ReadEntry(char *Line,struct ReadLogStruct Entry->HttpCode[HttpCodeLen]='\0'; Entry->Url[UrlLen]='\0'; Entry->User[UserLen]='\0'; - + return(RLRC_NoError); }