fail gracefully if libconfig fails to find root element

This commit is contained in:
yrutschle committed 2021-06-22 21:34:08 +02:00
1 parent 1ad450a444
commit bf2053eb79
4 files changed
+12 -4

No files matched your search

+5 -1
View File
@@ -1,5 +1,5 @@
/* Generated by conf2struct (https://www.rutschle.net/tech/conf2struct/README)
* on Sat May 8 07:03:13 2021.
* on Tue Jun 22 21:28:44 2021.
# conf2struct: generate libconf parsers that read to structs
# Copyright (C) 2018-2019 Yves Rutschle
@@ -1137,6 +1137,10 @@ int echocfg_cl_parse(int argc, char* argv[], struct echocfg_item* cfg)
}
s = config_lookup(&c, "/");
if (!s) {
fprintf(stderr, "Lookup of root config failed\n");
return -1;
}
res = read_block(s, cfg, table_echocfg, &errmsg);
if (!res) {
+1 -1
View File
@@ -1,5 +1,5 @@
/* Generated by conf2struct (https://www.rutschle.net/tech/conf2struct/README)
* on Sat May 8 07:03:13 2021.
* on Tue Jun 22 21:28:44 2021.
# conf2struct: generate libconf parsers that read to structs
# Copyright (C) 2018-2019 Yves Rutschle
+5 -1
View File
@@ -1,5 +1,5 @@
/* Generated by conf2struct (https://www.rutschle.net/tech/conf2struct/README)
* on Tue Mar 16 20:23:24 2021.
* on Tue Jun 22 21:28:43 2021.
# conf2struct: generate libconf parsers that read to structs
# Copyright (C) 2018-2019 Yves Rutschle
@@ -1793,6 +1793,10 @@ int sslhcfg_cl_parse(int argc, char* argv[], struct sslhcfg_item* cfg)
}
s = config_lookup(&c, "/");
if (!s) {
fprintf(stderr, "Lookup of root config failed\n");
return -1;
}
res = read_block(s, cfg, table_sslhcfg, &errmsg);
if (!res) {
+1 -1
View File
@@ -1,5 +1,5 @@
/* Generated by conf2struct (https://www.rutschle.net/tech/conf2struct/README)
* on Tue Mar 16 20:23:24 2021.
* on Tue Jun 22 21:28:43 2021.
# conf2struct: generate libconf parsers that read to structs
# Copyright (C) 2018-2019 Yves Rutschle