Silence parser warning about ParseState_done being unchecked
This commit is contained in:
parent
aa99b0b0bf
commit
96490bd41c
1 changed files with 4 additions and 8 deletions
|
@ -11,7 +11,6 @@ enum ParseState {
|
|||
ParseState_ip2,
|
||||
ParseState_port1,
|
||||
ParseState_port2,
|
||||
ParseState_done,
|
||||
};
|
||||
|
||||
// parse_ip parses an IP address line starting at startptr. Returns the ending position of the pointer in line.
|
||||
|
@ -105,7 +104,7 @@ char* parse_rule(char line[], struct Rule* result) {
|
|||
ptr += 1;
|
||||
state = ParseState_port2;
|
||||
} else {
|
||||
state = ParseState_done;
|
||||
goto finished_parsing;
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -119,16 +118,13 @@ char* parse_rule(char line[], struct Rule* result) {
|
|||
}
|
||||
ptr = (int)(end - line);
|
||||
|
||||
state = ParseState_done;
|
||||
break;
|
||||
goto finished_parsing;
|
||||
}
|
||||
}
|
||||
|
||||
if (state == ParseState_done) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
finished_parsing:
|
||||
|
||||
if (result->ip.end != NULL) {
|
||||
if (compare_ip(&result->ip.start, result->ip.end) == 1) {
|
||||
goto fail;
|
||||
|
|
Reference in a new issue