mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-16 15:57:00 +00:00
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 <kerolasa@iki.fi>
This commit is contained in:
parent
51143b6b3c
commit
70c65f4d59
1 changed files with 4 additions and 4 deletions
|
|
@ -65,7 +65,7 @@ int parse_leases(void)
|
||||||
char *line, *ipstring, macstring[20];
|
char *line, *ipstring, macstring[20];
|
||||||
union ipaddr_t addr;
|
union ipaddr_t addr;
|
||||||
struct stat lease_file_stats;
|
struct stat lease_file_stats;
|
||||||
int ethernets = false;
|
bool ethernets = false;
|
||||||
struct leases_t *lease;
|
struct leases_t *lease;
|
||||||
|
|
||||||
dhcpd_leases = fopen(config.dhcpdlease_file, "r");
|
dhcpd_leases = fopen(config.dhcpdlease_file, "r");
|
||||||
|
|
@ -244,7 +244,7 @@ void parse_config(int is_include, const char *restrict config_file,
|
||||||
switch (c) {
|
switch (c) {
|
||||||
/* Handle comments if they are not quoted */
|
/* Handle comments if they are not quoted */
|
||||||
case '#':
|
case '#':
|
||||||
if (quote == false) {
|
if (quote == 0) {
|
||||||
comment = true;
|
comment = true;
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -258,7 +258,7 @@ void parse_config(int is_include, const char *restrict config_file,
|
||||||
case '\n':
|
case '\n':
|
||||||
/* New line resets comment section, but
|
/* New line resets comment section, but
|
||||||
* not if quoted */
|
* not if quoted */
|
||||||
if (quote == false) {
|
if (quote == 0) {
|
||||||
comment = false;
|
comment = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -269,7 +269,7 @@ void parse_config(int is_include, const char *restrict config_file,
|
||||||
}
|
}
|
||||||
if (comment == false
|
if (comment == false
|
||||||
&& argument != ITS_A_RANGE_SECOND_IP
|
&& argument != ITS_A_RANGE_SECOND_IP
|
||||||
&& argument != 4) {
|
&& argument != ITS_AN_INCLUCE) {
|
||||||
newclause = true;
|
newclause = true;
|
||||||
i = 0;
|
i = 0;
|
||||||
} else if (argument == ITS_A_RANGE_SECOND_IP) {
|
} else if (argument == ITS_A_RANGE_SECOND_IP) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue