From 00e0e45c573b87a5098a3f2f9548c726da079af5 Mon Sep 17 00:00:00 2001 From: Peter Haag Date: Sat, 24 Feb 2024 09:46:07 +0100 Subject: [PATCH] Fix nfreader code --- src/nfreader/nfreader.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/nfreader/nfreader.c b/src/nfreader/nfreader.c index ed27a859..2da8b1b5 100755 --- a/src/nfreader/nfreader.c +++ b/src/nfreader/nfreader.c @@ -32,7 +32,7 @@ /* * nfreader is sample code for reading nfdump binary files. * It accepts the standard nfdump file select options -r, -M and -R - * Therefore it allows you to loop over multiple files and process the netflow record. + * Therefore it allows you to loop over multiple files to process all netflow records. * * Insert your code in the process_data function * To build the binary: first compile nfdump as usual. @@ -51,6 +51,7 @@ #include #include #include +#include #include #include #include @@ -253,10 +254,9 @@ static void process_data(void) { } // End of process_data int main(int argc, char **argv) { - flist_t flist; - int c; + flist_t flist = {0}; - memset((void *)&flist, 0, sizeof(flist)); + int c = 0; while ((c = getopt(argc, argv, "r:M:R:")) != EOF) { switch (c) { case 'h':