diff options
author | Yunchih Chen <yunchih.cat@gmail.com> | 2018-03-18 12:11:16 +0800 |
---|---|---|
committer | Yunchih Chen <yunchih.cat@gmail.com> | 2018-03-18 12:13:01 +0800 |
commit | 9bb96d09226ecaafa45f2d153c6a9f176d593bb3 (patch) | |
tree | 2b4d5ebeadfa4c0c59844a7f4e69b3ea0d29aa4b | |
parent | b2984ff31560ef94f8396a823f06178c0ee02d52 (diff) | |
download | nfcollect-9bb96d09226ecaafa45f2d153c6a9f176d593bb3.tar nfcollect-9bb96d09226ecaafa45f2d153c6a9f176d593bb3.tar.gz nfcollect-9bb96d09226ecaafa45f2d153c6a9f176d593bb3.tar.bz2 nfcollect-9bb96d09226ecaafa45f2d153c6a9f176d593bb3.tar.lz nfcollect-9bb96d09226ecaafa45f2d153c6a9f176d593bb3.tar.xz nfcollect-9bb96d09226ecaafa45f2d153c6a9f176d593bb3.tar.zst nfcollect-9bb96d09226ecaafa45f2d153c6a9f176d593bb3.zip |
Fix extractor bug
-rw-r--r-- | bin/nfextract.c | 4 | ||||
-rw-r--r-- | lib/common.c | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/bin/nfextract.c b/bin/nfextract.c index 6345389..b667733 100644 --- a/bin/nfextract.c +++ b/bin/nfextract.c @@ -70,8 +70,8 @@ static void extract_each(const char *storage_dir, const char *filename) { free(fullpath); char output[1024]; - for (int entry = 0; entry < trunk.header->n_entries; ++entry) { - nfl_format_output(output, trunk.store); + for (int i = 0; i < trunk.header->n_entries; ++i) { + nfl_format_output(output, &trunk.store[i]); puts((char *)output); } } diff --git a/lib/common.c b/lib/common.c index 20ef29f..804b803 100644 --- a/lib/common.c +++ b/lib/common.c @@ -107,7 +107,8 @@ void nfl_cal_entries(uint32_t trunk_size, uint32_t *entries_cnt) { } void nfl_format_output(char *output, nflog_entry_t *entry) { - sprintf(output, "t=%ld\t" + sprintf(output, " " + "t=%ld\t" "daddr=%s\t" "proto=%s\t" "uid=%d\t" |