Skip to content

Commit

Permalink
Fix: wrong error message emitted while parsing config
Browse files Browse the repository at this point in the history
  • Loading branch information
semigodking committed Nov 26, 2023
1 parent 6bd8a9c commit 11f7304
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion redsocks.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ static int redsocks_onexit(parser_section *section)
if (!instance->relay_ss)
err = "invalid `type` for redsocks";
}
else {
else if (!err) {
err = "no `type` for redsocks";
}

Expand Down
4 changes: 2 additions & 2 deletions redudp.c
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ static int redudp_onexit(parser_section *section)
err = "invalid dest address";
}

if (instance->config.type) {
if (!err && instance->config.type) {
udprelay_subsys **ss;
FOREACH(ss, relay_subsystems) {
if (!strcmp((*ss)->name, instance->config.type)) {
Expand All @@ -561,7 +561,7 @@ static int redudp_onexit(parser_section *section)
if (!instance->relay_ss)
err = "invalid `type` for redudp";
}
else {
else if (!err) {
err = "no `type` for redudp";
}

Expand Down

0 comments on commit 11f7304

Please sign in to comment.