commit cc7c900: [Minor] Sigh, reverse loop is bloody hard in C

Vsevolod Stakhov vsevolod at highsecure.ru
Sat Jan 29 13:14:04 UTC 2022


Author: Vsevolod Stakhov
Date: 2022-01-29 13:08:38 +0000
URL: https://github.com/rspamd/rspamd/commit/cc7c9000e05e1810d408f4e9b40e2073e85cb0fb (HEAD -> master)

[Minor] Sigh, reverse loop is bloody hard in C

---
 src/libmime/scan_result.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libmime/scan_result.c b/src/libmime/scan_result.c
index d2f7e0a8b..07800ea06 100644
--- a/src/libmime/scan_result.c
+++ b/src/libmime/scan_result.c
@@ -903,7 +903,7 @@ rspamd_check_action_metric (struct rspamd_task *task,
 	/*
 	 * Select result by score
 	 */
-	for (unsigned int i = scan_result->nactions - 1; i >= 0; i--) {
+	for (size_t i = scan_result->nactions - 1; i != (size_t)-1; i--) {
 		action_lim = &scan_result->actions_config[i];
 		sc = action_lim->cur_limit;
 


More information about the Commits mailing list