statzone

DNS zone file analyzer targeted at TLD zones
Log | Files | Refs | README | LICENSE

commit a2799723d7294d6d17b4a9bb273397cc20746524
parent bcfcf733667e8bcce672bb14f462f6c517225e15
Author: Frederic Cambus <fred@statdns.com>
Date:   Thu,  3 Jan 2019 22:10:44 +0100

Tokenize each line of the zone file using strtok.

Diffstat:
Msrc/statzone.c | 13+++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/statzone.c b/src/statzone.c @@ -47,6 +47,8 @@ displayUsage() { int main(int argc, char *argv[]) { + char *token = NULL; + while ((getoptFlag = getopt(argc, argv, "hv")) != -1) { switch(getoptFlag) { @@ -92,8 +94,15 @@ main(int argc, char *argv[]) { } while (fgets(lineBuffer, LINE_LENGTH_MAX, zoneFile)) { - if (*lineBuffer) - results.processedLines++; + if (*lineBuffer) { + token = strtok(lineBuffer, " \t"); + + while (token) { + token = strtok(NULL, " \t"); + } + } + + results.processedLines++; } /* Stopping timer */