From dca0a49e6d35f157e7ffdf8b0f3e61f707013e09 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 13 Feb 2024 15:04:24 +0000 Subject: [Fix] Make stat tokens allocation consistent --- src/libstat/stat_api.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/libstat/stat_api.h') diff --git a/src/libstat/stat_api.h b/src/libstat/stat_api.h index 1badb2001..798d0b481 100644 --- a/src/libstat/stat_api.h +++ b/src/libstat/stat_api.h @@ -1,11 +1,11 @@ -/*- - * Copyright 2016 Vsevolod Stakhov +/* + * Copyright 2024 Vsevolod Stakhov * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -53,13 +53,14 @@ typedef struct rspamd_stat_token_s { guint flags; } rspamd_stat_token_t; +#define RSPAMD_TOKEN_VALUE_TYPE float typedef struct token_node_s { guint64 data; guint window_idx; guint flags; rspamd_stat_token_t *t1; rspamd_stat_token_t *t2; - float values[]; + RSPAMD_TOKEN_VALUE_TYPE values[0]; } rspamd_token_t; struct rspamd_stat_ctx; -- cgit v1.2.3