]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virLogParseFilter: Replace virStringSplitCount by g_strsplit
authorPeter Krempa <pkrempa@redhat.com>
Mon, 22 Mar 2021 16:59:14 +0000 (17:59 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 12 Apr 2021 13:55:09 +0000 (15:55 +0200)
We don't really need the count.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/util/virlog.c

index d1ccba3e5de28bb0b5da3505aedc2c07ba662557..4bd3647c5742fcbd2cd8014e47e6ff7bbe9465fe 100644 (file)
@@ -1556,7 +1556,6 @@ virLogParseOutput(const char *src)
 virLogFilterPtr
 virLogParseFilter(const char *src)
 {
-    size_t count = 0;
     virLogPriority prio;
     g_auto(GStrv) tokens = NULL;
     char *match = NULL;
@@ -1564,7 +1563,8 @@ virLogParseFilter(const char *src)
     VIR_DEBUG("filter=%s", src);
 
     /* split our format prio:match_str to tokens and parse them individually */
-    if (!(tokens = virStringSplitCount(src, ":", 0, &count)) || count != 2) {
+    if (!(tokens = g_strsplit(src, ":", 0)) ||
+        !tokens[0] || !tokens[1]) {
         virReportError(VIR_ERR_INVALID_ARG,
                        _("Malformed format for filter '%s'"), src);
         return NULL;