diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-04-04 16:49:44 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-04-04 16:49:44 +0100 |
commit | e737e9942cc0c0cbd18dcbc9a1feb0a4b1c48a11 (patch) | |
tree | ba2ee3b7d49e603476dbe15e52d4a8c93c30474b /src/libstat/backends/mmaped_file.c | |
parent | 90f44e8ee59515936df340d5bace8ce68f515870 (diff) | |
download | rspamd-e737e9942cc0c0cbd18dcbc9a1feb0a4b1c48a11.tar.gz rspamd-e737e9942cc0c0cbd18dcbc9a1feb0a4b1c48a11.zip |
[Rework] Set token data as uint64_t instead of chars array
Diffstat (limited to 'src/libstat/backends/mmaped_file.c')
-rw-r--r-- | src/libstat/backends/mmaped_file.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libstat/backends/mmaped_file.c b/src/libstat/backends/mmaped_file.c index 50a635432..65ccb5aa1 100644 --- a/src/libstat/backends/mmaped_file.c +++ b/src/libstat/backends/mmaped_file.c @@ -963,8 +963,8 @@ rspamd_mmaped_file_process_tokens (struct rspamd_task *task, GPtrArray *tokens, for (i = 0; i < tokens->len; i++) { tok = g_ptr_array_index (tokens, i); - memcpy (&h1, tok->data, sizeof (h1)); - memcpy (&h2, tok->data + sizeof (h1), sizeof (h2)); + memcpy (&h1, (guchar *)&tok->data, sizeof (h1)); + memcpy (&h2, ((guchar *)&tok->data) + sizeof (h1), sizeof (h2)); tok->values[id] = rspamd_mmaped_file_get_block (mf, h1, h2); } @@ -993,8 +993,8 @@ rspamd_mmaped_file_learn_tokens (struct rspamd_task *task, GPtrArray *tokens, for (i = 0; i < tokens->len; i++) { tok = g_ptr_array_index (tokens, i); - memcpy (&h1, tok->data, sizeof (h1)); - memcpy (&h2, tok->data + sizeof (h1), sizeof (h2)); + memcpy (&h1, (guchar *)&tok->data, sizeof (h1)); + memcpy (&h2, ((guchar *)&tok->data) + sizeof (h1), sizeof (h2)); rspamd_mmaped_file_set_block (task->task_pool, mf, h1, h2, tok->values[id]); } |