From: Frederic Marchal Date: Wed, 26 Dec 2012 16:14:56 +0000 (+0100) Subject: Make sure the total number of lines read is big enough X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8e501bd6d28f3555770630368c041d0d2f7acf62;p=thirdparty%2Fsarg.git Make sure the total number of lines read is big enough Use an unsigned long int to store the number of lines read from the access log file. --- diff --git a/readlog.c b/readlog.c index fae5b86..86a6521 100644 --- a/readlog.c +++ b/readlog.c @@ -72,7 +72,7 @@ static long int totregsx=0; //! The beginning of a linked list of user's file. static struct userfilestruct *first_user_file=NULL; //! Count the number of occurence of each input log format. -static int format_count[sizeof(LogFormats)/sizeof(*LogFormats)]; +static unsigned long int format_count[sizeof(LogFormats)/sizeof(*LogFormats)]; //! The minimum date found in the input logs. static int mindate=0; static int maxdate=0; @@ -658,7 +658,7 @@ int ReadLogFile(struct ReadLogDataStruct *Filter) } if (debug) { - int totalcount=0; + unsigned long int totalcount=0; debuga(_(" Records read: %ld, written: %ld, excluded: %ld\n"),totregsl,totregsg,totregsx); @@ -667,7 +667,7 @@ int ReadLogFile(struct ReadLogDataStruct *Filter) /* TRANSLATORS: It displays the number of lines found in the input log files * for each supported log format. The log format name is the %s and is a string * you translate somewhere else. */ - debuga(_("%s: %d entries\n"),_(LogFormats[x]->Name),format_count[x]); + debuga(_("%s: %lu entries\n"),_(LogFormats[x]->Name),format_count[x]); totalcount+=format_count[x]; } }