diff options
author | Max Kellermann <max@duempel.org> | 2013-10-15 22:32:39 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-10-15 22:49:01 +0200 |
commit | 7de96275dd6e3b6997e799413e4537561041e199 (patch) | |
tree | 4eab0c018168c14eb22f9e086917d16ef3f8f6a8 /src/ConfigGlobal.cxx | |
parent | e13d0bf65653550c4cfe3f879441139f5242d8b1 (diff) | |
download | mpd-7de96275dd6e3b6997e799413e4537561041e199.tar.gz mpd-7de96275dd6e3b6997e799413e4537561041e199.tar.xz mpd-7de96275dd6e3b6997e799413e4537561041e199.zip |
ConfigData: use std::string for config_param::value
Diffstat (limited to 'src/ConfigGlobal.cxx')
-rw-r--r-- | src/ConfigGlobal.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ConfigGlobal.cxx b/src/ConfigGlobal.cxx index b68a34a38..e23462e94 100644 --- a/src/ConfigGlobal.cxx +++ b/src/ConfigGlobal.cxx @@ -93,7 +93,7 @@ config_get_string(ConfigOption option, const char *default_value) if (param == nullptr) return default_value; - return param->value; + return param->value.c_str(); } Path @@ -109,7 +109,7 @@ config_get_path(ConfigOption option, Error &error) Path config_parse_path(const struct config_param *param, Error & error) { - Path path = ParsePath(param->value, error); + Path path = ParsePath(param->value.c_str(), error); if (gcc_unlikely(path.IsNull())) error.FormatPrefix("Invalid path at line %i: ", param->line); @@ -127,7 +127,7 @@ config_get_unsigned(ConfigOption option, unsigned default_value) if (param == nullptr) return default_value; - value = strtol(param->value, &endptr, 0); + value = strtol(param->value.c_str(), &endptr, 0); if (*endptr != 0 || value < 0) FormatFatalError("Not a valid non-negative number in line %i", param->line); @@ -145,7 +145,7 @@ config_get_positive(ConfigOption option, unsigned default_value) if (param == nullptr) return default_value; - value = strtol(param->value, &endptr, 0); + value = strtol(param->value.c_str(), &endptr, 0); if (*endptr != 0) FormatFatalError("Not a valid number in line %i", param->line); @@ -165,7 +165,7 @@ config_get_bool(ConfigOption option, bool default_value) if (param == nullptr) return default_value; - success = get_bool(param->value, &value); + success = get_bool(param->value.c_str(), &value); if (!success) FormatFatalError("Expected boolean value (yes, true, 1) or " "(no, false, 0) on line %i\n", |