summaryrefslogtreecommitdiff
path: root/minecproxy
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2020-06-24 00:16:51 +0200
committerDavid Härdeman <david@hardeman.nu>2020-06-24 00:16:51 +0200
commit3afaf3d8f7617beed427c96e544ab177fabadaa4 (patch)
tree2e21acbbd074029da9a51e667ecc38fbcedeabf8 /minecproxy
parent460b10553ac898232bfc5444e335dfa938690d1b (diff)
Simplify config_parse_header
Diffstat (limited to 'minecproxy')
-rw-r--r--minecproxy/main.c4
-rw-r--r--minecproxy/server-config.c4
2 files changed, 5 insertions, 3 deletions
diff --git a/minecproxy/main.c b/minecproxy/main.c
index bbe3fad..3c996ad 100644
--- a/minecproxy/main.c
+++ b/minecproxy/main.c
@@ -298,8 +298,8 @@ cfg_read()
*pos = '\0';
pos = buf;
- if (!config_parse_header(path, "mcproxy", &pos))
- die("main config file (%s) invalid", path);
+ if (!config_parse_header("mcproxy", &pos))
+ die("main config file (%s) missing/invalid header", path);
while (true) {
int key;
diff --git a/minecproxy/server-config.c b/minecproxy/server-config.c
index 4e16155..e7cc422 100644
--- a/minecproxy/server-config.c
+++ b/minecproxy/server-config.c
@@ -154,8 +154,10 @@ scfg_parse(struct server *server)
pos = server->tbuf.buf;
- if (!config_parse_header(server->name, SERVER_CFG_HEADER, &pos))
+ if (!config_parse_header(SERVER_CFG_HEADER, &pos)) {
+ verbose("%s: missing/invalid header", server->name);
return;
+ }
while (true) {
int key;