From 60141f2074a9911fb0901408e706cd3c5ac4c7f5 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Thu, 27 Aug 2020 07:40:19 +0200 Subject: [PATCH] logger: Fix log level parsing Usage of strstr for short version of logs level definitions (for example 'e') leads to invalid level parsing, because first log level with defined string (or letter) will be returned (in this example 'verbose'). After change, log level will be returned only when name is exactly as given one. Fixes: b1fc9220 (logger: Parse runtime filter levels) Signed-off-by: Karol Trzcinski --- tools/logger/filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/logger/filter.c b/tools/logger/filter.c index f1396d5e9..56ac41b3d 100644 --- a/tools/logger/filter.c +++ b/tools/logger/filter.c @@ -82,7 +82,7 @@ static int filter_parse_log_level(const char *value_start) int i; for (i = 0; i < ARRAY_SIZE(log_level_dict); ++i) { - if (strstr(log_level_dict[i].name, value_start)) + if (!strcmp(log_level_dict[i].name, value_start)) return log_level_dict[i].log_level; } return -1;