aboutsummaryrefslogtreecommitdiffstats
path: root/src/conf.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-25 16:04:03 +0100
committerMax Kellermann <max@duempel.org>2009-01-25 16:04:03 +0100
commit3635c93acbc3da87880e886d924020c427d1774a (patch)
tree4143b680e78794866744b3ac1d0a721d738872c2 /src/conf.c
parent5f7791009790dc40f2d76be310ffeab55c242ced (diff)
downloadmpd-3635c93acbc3da87880e886d924020c427d1774a.tar.gz
mpd-3635c93acbc3da87880e886d924020c427d1774a.tar.xz
mpd-3635c93acbc3da87880e886d924020c427d1774a.zip
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.
Diffstat (limited to 'src/conf.c')
-rw-r--r--src/conf.c3
1 files changed, 3 insertions, 0 deletions
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) {