commit 8421d614d9f21ba9dd42ade41af444332dcb2d0d
parent ce4ea13d1202580dc3335a9e23a44f08cae2a22e
Author: Frederic Cambus <fred@statdns.com>
Date: Sat, 5 Jan 2019 21:18:46 +0100
If the first token isn't NULL, save the domain name.
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/statzone.c b/src/statzone.c
@@ -40,6 +40,8 @@ int8_t getoptFlag;
char *intputFile;
+char *domain;
+
void
displayUsage() {
printf("USAGE: statzone [options] inputfile\n\n" \
@@ -100,6 +102,9 @@ main(int argc, char *argv[]) {
while (fgets(lineBuffer, LINE_LENGTH_MAX, zoneFile)) {
if (*lineBuffer) {
token = strtok(lineBuffer, " \t");
+
+ if (token)
+ domain = strtolower(token);
while (token) {
token_lc = strtolower(token);