]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Sigh, reverse loop is bloody hard in C
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 29 Jan 2022 13:08:38 +0000 (13:08 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 29 Jan 2022 13:08:38 +0000 (13:08 +0000)
src/libmime/scan_result.c

index d2f7e0a8bc3b0fc8901727a6286611461a42b2b0..07800ea060e81cd21ce6009f4f88c45d145dfdfd 100644 (file)
@@ -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;