From: Peter Krempa Date: Mon, 22 Mar 2021 17:02:28 +0000 (+0100) Subject: virLogParseOutput: Replace virStringSplitCount by g_strsplit X-Git-Tag: v7.3.0-rc1~299 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d338715dfb917342ab9c41bf51f03f4555305a5c;p=thirdparty%2Flibvirt.git virLogParseOutput: Replace virStringSplitCount by g_strsplit Unfortunately here we do need the count of elements. Use g_strv_length to calculate it so that virStringSplitCount can be removed later. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- diff --git a/src/util/virlog.c b/src/util/virlog.c index 4bd3647c57..7778724d58 100644 --- a/src/util/virlog.c +++ b/src/util/virlog.c @@ -1470,7 +1470,8 @@ virLogParseOutput(const char *src) /* split our format prio:destination:additional_data to tokens and parse * them individually */ - if (!(tokens = virStringSplitCount(src, ":", 0, &count)) || count < 2) { + if (!(tokens = g_strsplit(src, ":", 0)) || + (count = g_strv_length(tokens)) < 2) { virReportError(VIR_ERR_INVALID_ARG, _("Malformed format for output '%s'"), src); return NULL;