This commit is contained in:
akp 2023-10-06 23:03:37 +01:00
parent 7715c9da29
commit e95a1607dd
No known key found for this signature in database
GPG key ID: CF8D58F3DEB20755

View file

@ -40,6 +40,8 @@ char* parse_ip(char* startptr, struct IP* ip) {
return endptr;
}
// parse_rule parses a rule out a string, line. The result is saved to result, which must be allocated by the caller.
// The return value is the ending position of the rule in the string.
char* parse_rule(char line[], struct Rule* result) {
enum ParseState state = ParseState_ip1;
@ -119,7 +121,7 @@ char* parse_rule(char line[], struct Rule* result) {
break;
}
}
if (result->ip.end != NULL) {
if (compare_ip(&result->ip.start, result->ip.end) == 1) {
goto fail;