Re: [PATCH 15/39] virLogParseFilter: Replace virStringSplitCount by g_strsplit

2021-04-07 Thread Ján Tomko

On a Thursday in 2021, Peter Krempa wrote:

We don't really need the count.

Signed-off-by: Peter Krempa 
---
src/util/virlog.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)



Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: PGP signature


[PATCH 15/39] virLogParseFilter: Replace virStringSplitCount by g_strsplit

2021-04-01 Thread Peter Krempa
We don't really need the count.

Signed-off-by: Peter Krempa 
---
 src/util/virlog.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/util/virlog.c b/src/util/virlog.c
index 57eb0de538..8a4cfbfdc2 100644
--- a/src/util/virlog.c
+++ b/src/util/virlog.c
@@ -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 != 2) {
+if (!(tokens = g_strsplit(src, ":", 0)) ||
+!tokens[0] || !tokens[1]) {
 virReportError(VIR_ERR_INVALID_ARG,
_("Malformed format for filter '%s'"), src);
 return NULL;
-- 
2.29.2