]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virLogParseOutput: Replace virStringSplitCount by g_strsplit
authorPeter Krempa <pkrempa@redhat.com>
Mon, 22 Mar 2021 17:02:28 +0000 (18:02 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 12 Apr 2021 13:55:09 +0000 (15:55 +0200)
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 <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/util/virlog.c

index 4bd3647c5742fcbd2cd8014e47e6ff7bbe9465fe..7778724d58f5dfd9e3b2696b23a4f828d010ec67 100644 (file)
@@ -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;