summaryrefslogtreecommitdiff
path: root/minecproxy
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2020-06-30 10:03:07 +0200
committerDavid Härdeman <david@hardeman.nu>2020-06-30 10:03:07 +0200
commitb2961ea4a792fa7e5bead6e49d399dcea55b039b (patch)
tree56e7f89f49c1281eaad1a2a0cd45db3ad723acbf /minecproxy
parent4b6f946c0871d1f510135cd43d61034d55fae5fd (diff)
Keep track of current line number in config file parsing
Diffstat (limited to 'minecproxy')
-rw-r--r--minecproxy/main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/minecproxy/main.c b/minecproxy/main.c
index b5a195b..92961e2 100644
--- a/minecproxy/main.c
+++ b/minecproxy/main.c
@@ -255,6 +255,7 @@ static void cfg_read()
char *pos = buf;
size_t rd = 0;
size_t r;
+ unsigned lineno;
assert_return(cfg);
@@ -294,7 +295,7 @@ static void cfg_read()
*pos = '\0';
pos = buf;
- if (!config_parse_header("mcproxy", &pos))
+ if (!config_parse_header("mcproxy", &pos, &lineno))
die("main config file (%s) missing/invalid header", path);
while (true) {
@@ -303,7 +304,7 @@ static void cfg_read()
struct cfg_value value;
if (!config_parse_line(path, &pos, mcfg_key_map, &key, &keyname,
- &value, false))
+ &value, false, &lineno))
break;
if (key == MCFG_KEY_INVALID)