aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-25 16:00:51 +0100
committerMax Kellermann <max@duempel.org>2009-01-25 16:00:51 +0100
commit80799fa84eb4330083e4de20b87f97beea7d6ba7 (patch)
treec2a329d7fc7b08213ea83bdbaa169e95a78b6cd3 /src/utils.c
parentbdfb6c239af53d72f0808fc34e15d671036e8832 (diff)
downloadmpd-80799fa84eb4330083e4de20b87f97beea7d6ba7.tar.gz
mpd-80799fa84eb4330083e4de20b87f97beea7d6ba7.tar.xz
mpd-80799fa84eb4330083e4de20b87f97beea7d6ba7.zip
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.
Diffstat (limited to '')
-rw-r--r--src/utils.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/utils.c b/src/utils.c
index a2f112e72..ce9a09f72 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -65,12 +65,11 @@ char *parsePath(char *path)
const char *home;
if (path[1] == '/' || path[1] == '\0') {
- struct config_param *param = config_get_param(CONF_USER);
- if (param && param->value) {
- struct passwd *passwd = getpwnam(param->value);
+ const char *user = config_get_string(CONF_USER, NULL);
+ if (user != NULL) {
+ struct passwd *passwd = getpwnam(user);
if (!passwd) {
- g_warning("no such user %s",
- param->value);
+ g_warning("no such user %s", user);
return NULL;
}