diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-10-17 18:19:18 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-10-17 18:19:18 +0100 |
commit | 3351b30b969716f83d9166025c6d940e7eedde5f (patch) | |
tree | cd8f11524a1c0609002e70a45a4c736e68676827 /src/libutil/map.c | |
parent | c0d2f5b0c3da61cbb03de38bc59b6c5279366428 (diff) | |
download | rspamd-3351b30b969716f83d9166025c6d940e7eedde5f.tar.gz rspamd-3351b30b969716f83d9166025c6d940e7eedde5f.zip |
[Minor] Do not use floating point when extending buffers
Diffstat (limited to 'src/libutil/map.c')
-rw-r--r-- | src/libutil/map.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libutil/map.c b/src/libutil/map.c index 123d31c5f..02e3913a4 100644 --- a/src/libutil/map.c +++ b/src/libutil/map.c @@ -456,7 +456,7 @@ http_map_finish (struct rspamd_http_connection *conn, if (zout.pos == zout.size) { /* We need to extend output buffer */ - zout.size = zout.size * 1.5 + 1.0; + zout.size = zout.size * 2 + 1.0; out = g_realloc (zout.dst, zout.size); zout.dst = out; } @@ -835,7 +835,7 @@ read_map_file (struct rspamd_map *map, struct file_map_data *data, if (zout.pos == zout.size) { /* We need to extend output buffer */ - zout.size = zout.size * 1.5 + 1.0; + zout.size = zout.size * 2 + 1; out = g_realloc (zout.dst, zout.size); zout.dst = out; } @@ -922,7 +922,7 @@ read_map_static (struct rspamd_map *map, struct static_map_data *data, if (zout.pos == zout.size) { /* We need to extend output buffer */ - zout.size = zout.size * 1.5 + 1.0; + zout.size = zout.size * 2 + 1; out = g_realloc (zout.dst, zout.size); zout.dst = out; } @@ -1201,7 +1201,7 @@ rspamd_map_read_cached (struct rspamd_map *map, struct rspamd_map_backend *bk, if (zout.pos == zout.size) { /* We need to extend output buffer */ - zout.size = zout.size * 1.5 + 1.0; + zout.size = zout.size * 2 + 1; out = g_realloc (zout.dst, zout.size); zout.dst = out; } |