]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Make sure the total number of lines read is big enough
authorFrederic Marchal <fmarchal@users.sourceforge.net>
Wed, 26 Dec 2012 16:14:56 +0000 (17:14 +0100)
committerFrederic Marchal <fmarchal@users.sourceforge.net>
Wed, 26 Dec 2012 16:14:56 +0000 (17:14 +0100)
Use an unsigned long int to store the number of lines read from the access
log file.

readlog.c

index fae5b86813d8091056666962fdbf4e10d2cd8a95..86a652174f7fa5e8326e94d9c8e634ce7fb91f79 100644 (file)
--- 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];
                        }
                }