commit 3c6f559f00b7b39d06e19926dff8640fe91e6d28
parent 09882fc652e370d925d15f9bf52e7540a30d7d34
Author: Frederic Cambus <fred@statdns.com>
Date: Sun, 20 Jan 2019 10:10:49 +0100
Do not attempt to tokenize comments and directives.
Diffstat:
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/statzone.c b/src/statzone.c
@@ -4,7 +4,7 @@
* https://www.statdns.com
*
* Created: 2012-02-13
- * Last Updated: 2019-01-09
+ * Last Updated: 2019-01-20
*
* StatZone is released under the BSD 2-Clause license
* See LICENSE file for details.
@@ -115,6 +115,12 @@ main(int argc, char *argv[]) {
}
while (fgets(lineBuffer, LINE_LENGTH_MAX, zoneFile)) {
+ if (*lineBuffer == ';') /* Comments */
+ continue;
+
+ if (*lineBuffer == '$') /* Directives */
+ continue;
+
if (*lineBuffer) {
token = strtok(lineBuffer, " \t");