From 3635c93acbc3da87880e886d924020c427d1774a Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 25 Jan 2009 16:04:03 +0100 Subject: conf: allow param==NULL Return the default value in the conf_get_block_*() functions when param==NULL was passed. This simplifies a lot of code, because all initialization can be done in one code path, regardless whether configuration is present. --- src/conf.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/conf.c') diff --git a/src/conf.c b/src/conf.c index fbb348cf9..9dfebc059 100644 --- a/src/conf.c +++ b/src/conf.c @@ -433,6 +433,9 @@ getBlockParam(const struct config_param * param, const char *name) struct block_param *ret = NULL; int i; + if (param == NULL) + return NULL; + for (i = 0; i < param->num_block_params; i++) { if (0 == strcmp(name, param->block_params[i].name)) { if (ret) { -- cgit v1.2.3