aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-01-12 12:00:46 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-01-12 12:00:46 +0000
commit397eeeb6d90d523372ced1f176a347a0890abbc4 (patch)
treed484671e756534b54919f4f96743aa00a2635545 /src
parent2939b3c08fbdab69981b781fce05fa5cb81e0a1d (diff)
downloadrspamd-397eeeb6d90d523372ced1f176a347a0890abbc4.tar.gz
rspamd-397eeeb6d90d523372ced1f176a347a0890abbc4.zip
[CritFix] Repair PTR_ARRAY_FOREACH macro
MFH: true
Diffstat (limited to 'src')
-rw-r--r--src/libutil/util.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libutil/util.h b/src/libutil/util.h
index 221ebc0d4..cfea5f851 100644
--- a/src/libutil/util.h
+++ b/src/libutil/util.h
@@ -516,5 +516,5 @@ gdouble rspamd_normalize_probability (gdouble x, gdouble bias);
*/
guint64 rspamd_tm_to_time (const struct tm *tm, glong tz);
-#define PTR_ARRAY_FOREACH(ar, i, cur) if (ar != NULL && ar->len > 0) for ((i) = 0, (cur) = g_ptr_array_index((ar), 0); (i) < (ar)->len; (cur) = g_ptr_array_index((ar), (i + 1)), ++(i))
+#define PTR_ARRAY_FOREACH(ar, i, cur) if ((ar) != NULL && (ar)->len > 0) for ((i) = 0; (i) < (ar)->len && (((cur) = g_ptr_array_index((ar), (i))) || 1); ++(i))
#endif