From d3d9a04e622d3f12b71e66e1a105cd6eb7163a06 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 2 Dec 2014 22:29:41 +0100 Subject: output/ao: use class SplitString instead of g_strsplit() --- src/output/plugins/AoOutputPlugin.cxx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src') 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 ¶m, 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); -- cgit v1.2.3