From 11f730439803017732b8a7b11d64fe0608944181 Mon Sep 17 00:00:00 2001 From: Zhuofei Wang Date: Sun, 26 Nov 2023 22:20:29 +0800 Subject: [PATCH] Fix: wrong error message emitted while parsing config --- redsocks.c | 2 +- redudp.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/redsocks.c b/redsocks.c index 78eb1b0..14c91a4 100644 --- a/redsocks.c +++ b/redsocks.c @@ -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"; } diff --git a/redudp.c b/redudp.c index 3ad0f24..bd60c49 100644 --- a/redudp.c +++ b/redudp.c @@ -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)) { @@ -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"; }