X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fconf.c;h=90bd3697b9f0ae46b2af7fc63d34a6ec1a8e2262;hb=0871c3095151bce6a4031a2662aa51b7193b855c;hp=a0107d0249d85414c9a535210f2036dcf2f83705;hpb=9e917cc3b614d7a986416e6a2c3ea9ea583adacf;p=tinc diff --git a/src/conf.c b/src/conf.c index a0107d02..90bd3697 100644 --- a/src/conf.c +++ b/src/conf.c @@ -38,7 +38,14 @@ splay_tree_t *config_tree = NULL; int pinginterval = 0; /* seconds between pings */ int pingtimeout = 0; /* seconds to wait for response */ -list_t *cmdline_conf = NULL; /* global/host configuration values given at the command line */ + +/* global/host configuration values given at the command line */ +list_t cmdline_conf = { + .head = NULL, + .tail = NULL, + .count = 0, + .delete = (list_action_t)free_config, +}; static int config_compare(const config_t *a, const config_t *b) { int result; @@ -334,13 +341,9 @@ bool read_config_file(splay_tree_t *config_tree, const char *fname, bool verbose } void read_config_options(splay_tree_t *config_tree, const char *prefix) { - if(!cmdline_conf) { - return; - } - size_t prefix_len = prefix ? strlen(prefix) : 0; - for(const list_node_t *node = cmdline_conf->tail; node; node = node->prev) { + for(const list_node_t *node = cmdline_conf.tail; node; node = node->prev) { const config_t *cfg = node->data; config_t *new;