@cryptotaxi247 / netdata-1 / commits / c51e7aa7c

fix journal direction parsing (#15957)

Costa Tsaousis committed Sep 13, 2023 at 13:56 UTC c51e7aa7c2379eda50df93ae6375228693f3a963
1 file changed +1 -1
collectors/systemd-journal.plugin/systemd-journal.c
+1 -1
@@ -452,7 +452,7 @@ static void function_systemd_journal(const char *transaction, char *function, ch
452 anchor = str2ull(&keyword[sizeof(JOURNAL_PARAMETER_ANCHOR ":") - 1], NULL);
453 }
454 else if(strncmp(keyword, JOURNAL_PARAMETER_DIRECTION ":", sizeof(JOURNAL_PARAMETER_DIRECTION ":") - 1) == 0) {
455 - direction = strcasecmp(&keyword[sizeof(JOURNAL_PARAMETER_DIRECTION ":") - 1], "forward") ? FACETS_ANCHOR_DIRECTION_FORWARD : FACETS_ANCHOR_DIRECTION_BACKWARD;
455 + direction = strcasecmp(&keyword[sizeof(JOURNAL_PARAMETER_DIRECTION ":") - 1], "forward") == 0 ? FACETS_ANCHOR_DIRECTION_FORWARD : FACETS_ANCHOR_DIRECTION_BACKWARD;
456 }
457 else if(strncmp(keyword, JOURNAL_PARAMETER_LAST ":", sizeof(JOURNAL_PARAMETER_LAST ":") - 1) == 0) {
458 last = str2ul(&keyword[sizeof(JOURNAL_PARAMETER_LAST ":") - 1]);