From 48b9b290882dc57e568944cf888b643db4bedecf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awomir=20Lach?= Date: Sun, 14 Feb 2021 14:30:43 +0100 Subject: [PATCH 2/3] - Assertion repair --- common/counters.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/common/counters.c b/common/counters.c index 97097bf012..f2462ca854 100644 --- a/common/counters.c +++ b/common/counters.c @@ -61,7 +61,7 @@ struct counter *counter_by_id(int id) { int i; - fc_assert_ret_val(id >= MAX_COUNTERS, NULL); + fc_assert_ret_val(id < MAX_COUNTERS, NULL); for (i = 0; i < MAX_COUNTERS; i++) { @@ -90,8 +90,8 @@ int counter_id(struct counter *pcount) struct counter *counter_by_rule_name(const char *name) { int i; - fc_assert_ret_val(NULL == name, NULL); - fc_assert_ret_val('\0' == name[0], NULL); + fc_assert_ret_val(NULL != name, NULL); + fc_assert_ret_val('\0' != name[0], NULL); for (i = 0; i < MAX_COUNTERS; i++) { @@ -109,6 +109,7 @@ struct counter *counter_by_rule_name(const char *name) ****************************************************************************/ const char *counter_rule_name(struct counter *pcount) { + fc_assert_ret_val(NULL != pcount, NULL); return pcount->rule_name; } -- 2.30.0