From c51e7aa7c2379eda50df93ae6375228693f3a963 Mon Sep 17 00:00:00 2001 From: Costa Tsaousis Date: Wed, 13 Sep 2023 13:56:43 +0300 Subject: fix journal direction parsing (#15957) --- collectors/systemd-journal.plugin/systemd-journal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'collectors/systemd-journal.plugin/systemd-journal.c') diff --git a/collectors/systemd-journal.plugin/systemd-journal.c b/collectors/systemd-journal.plugin/systemd-journal.c index ddabf9e49f..1fe8804a77 100644 --- a/collectors/systemd-journal.plugin/systemd-journal.c +++ b/collectors/systemd-journal.plugin/systemd-journal.c @@ -452,7 +452,7 @@ static void function_systemd_journal(const char *transaction, char *function, ch anchor = str2ull(&keyword[sizeof(JOURNAL_PARAMETER_ANCHOR ":") - 1], NULL); } else if(strncmp(keyword, JOURNAL_PARAMETER_DIRECTION ":", sizeof(JOURNAL_PARAMETER_DIRECTION ":") - 1) == 0) { - direction = strcasecmp(&keyword[sizeof(JOURNAL_PARAMETER_DIRECTION ":") - 1], "forward") ? FACETS_ANCHOR_DIRECTION_FORWARD : FACETS_ANCHOR_DIRECTION_BACKWARD; + direction = strcasecmp(&keyword[sizeof(JOURNAL_PARAMETER_DIRECTION ":") - 1], "forward") == 0 ? FACETS_ANCHOR_DIRECTION_FORWARD : FACETS_ANCHOR_DIRECTION_BACKWARD; } else if(strncmp(keyword, JOURNAL_PARAMETER_LAST ":", sizeof(JOURNAL_PARAMETER_LAST ":") - 1) == 0) { last = str2ul(&keyword[sizeof(JOURNAL_PARAMETER_LAST ":") - 1]); -- cgit v1.2.3