use config_get_string() instead of config_get_param()

config_get_string() is easier to use than config_get_param() because
it unpacks the config_param struct.
This commit is contained in:
Max Kellermann
2009-01-25 16:00:51 +01:00
parent bdfb6c239a
commit 80799fa84e
5 changed files with 24 additions and 31 deletions

View File

@@ -35,17 +35,13 @@ static int zeroconfEnabled;
void initZeroconf(void)
{
const char *serviceName = SERVICE_NAME;
struct config_param *param;
zeroconfEnabled = config_get_bool(CONF_ZEROCONF_ENABLED,
DEFAULT_ZEROCONF_ENABLED);
if (!zeroconfEnabled)
return;
param = config_get_param(CONF_ZEROCONF_NAME);
if (param && *param->value != 0)
serviceName = param->value;
serviceName = config_get_string(CONF_ZEROCONF_NAME, NULL);
#ifdef HAVE_AVAHI
init_avahi(serviceName);