diff options
author | Costa Tsaousis <costa@netdata.cloud> | 2023-09-13 13:56:43 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-13 13:56:43 +0300 |
commit | c51e7aa7c2379eda50df93ae6375228693f3a963 (patch) | |
tree | eab8bee9ebc5f58ebfba9c395f9f07f0489075f4 /collectors/systemd-journal.plugin/systemd-journal.c | |
parent | fe3dd763a905493d545eb771631760921f6bdb3a (diff) |
fix journal direction parsing (#15957)
Diffstat (limited to 'collectors/systemd-journal.plugin/systemd-journal.c')
-rw-r--r-- | collectors/systemd-journal.plugin/systemd-journal.c | 2 |
1 files changed, 1 insertions, 1 deletions
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]); |