aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-12-02 22:29:41 +0100
committerMax Kellermann <max@duempel.org>2014-12-02 22:29:41 +0100
commitd3d9a04e622d3f12b71e66e1a105cd6eb7163a06 (patch)
tree60be8b7014d680c39fd8cfa2d239af23a3ee75c0 /src
parenta66051216f520d5a863c557433733f3e20b37d17 (diff)
downloadmpd-d3d9a04e622d3f12b71e66e1a105cd6eb7163a06.tar.gz
mpd-d3d9a04e622d3f12b71e66e1a105cd6eb7163a06.tar.xz
mpd-d3d9a04e622d3f12b71e66e1a105cd6eb7163a06.zip
output/ao: use class SplitString instead of g_strsplit()
Diffstat (limited to 'src')
-rw-r--r--src/output/plugins/AoOutputPlugin.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/output/plugins/AoOutputPlugin.cxx b/src/output/plugins/AoOutputPlugin.cxx
index af8c88fa1..2b66fb8db 100644
--- a/src/output/plugins/AoOutputPlugin.cxx
+++ b/src/output/plugins/AoOutputPlugin.cxx
@@ -20,6 +20,7 @@
#include "config.h"
#include "AoOutputPlugin.hxx"
#include "../OutputAPI.hxx"
+#include "util/SplitString.hxx"
#include "util/Error.hxx"
#include "util/Domain.hxx"
#include "Log.hxx"
@@ -129,19 +130,16 @@ AoOutput::Configure(const config_param &param, Error &error)
gchar **_options = g_strsplit(value, ";", 0);
for (unsigned i = 0; _options[i] != nullptr; ++i) {
- gchar **key_value = g_strsplit(_options[i], "=", 2);
+ const SplitString ss(_options[i], '=');
- if (key_value[0] == nullptr || key_value[1] == nullptr) {
+ if (!ss.IsDefined()) {
error.Format(ao_output_domain,
"problems parsing options \"%s\"",
_options[i]);
return false;
}
- ao_append_option(&options, key_value[0],
- key_value[1]);
-
- g_strfreev(key_value);
+ ao_append_option(&options, ss.GetFirst(), ss.GetSecond());
}
g_strfreev(_options);