From 70c65f4d593c539b2a216672a9564136c2a2bb79 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sun, 9 Dec 2012 23:38:37 +0000 Subject: [PATCH] getdata: be consistant with symbolic numbers The program counts quotes, which is never true/false value, and one of the symbolic parse state values was missed in bd5ee58. Signed-off-by: Sami Kerola --- src/getdata.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/getdata.c b/src/getdata.c index b74c5d1..39061d3 100644 --- a/src/getdata.c +++ b/src/getdata.c @@ -65,7 +65,7 @@ int parse_leases(void) char *line, *ipstring, macstring[20]; union ipaddr_t addr; struct stat lease_file_stats; - int ethernets = false; + bool ethernets = false; struct leases_t *lease; dhcpd_leases = fopen(config.dhcpdlease_file, "r"); @@ -244,7 +244,7 @@ void parse_config(int is_include, const char *restrict config_file, switch (c) { /* Handle comments if they are not quoted */ case '#': - if (quote == false) { + if (quote == 0) { comment = true; } continue; @@ -258,7 +258,7 @@ void parse_config(int is_include, const char *restrict config_file, case '\n': /* New line resets comment section, but * not if quoted */ - if (quote == false) { + if (quote == 0) { comment = false; } break; @@ -269,7 +269,7 @@ void parse_config(int is_include, const char *restrict config_file, } if (comment == false && argument != ITS_A_RANGE_SECOND_IP - && argument != 4) { + && argument != ITS_AN_INCLUCE) { newclause = true; i = 0; } else if (argument == ITS_A_RANGE_SECOND_IP) {