aboutsummaryrefslogtreecommitdiffstats
path: root/src/settings.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-08-04 20:31:24 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-08-04 20:31:24 +0400
commit3f96e6a7a317e70b85b32de4aa06681c11d79006 (patch)
tree70343e3fb1a43d29d9c4f454fa47b2dcad6249ad /src/settings.c
parent6b86782ce21caad081d41f54ef10233a8e757189 (diff)
downloadrspamd-3f96e6a7a317e70b85b32de4aa06681c11d79006.tar.gz
rspamd-3f96e6a7a317e70b85b32de4aa06681c11d79006.zip
Fix signness in arithmetic operations.
Diffstat (limited to 'src/settings.c')
-rw-r--r--src/settings.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/settings.c b/src/settings.c
index b5786d393..31cc95b1c 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -111,7 +111,7 @@ settings_unref (struct rspamd_settings *s)
gchar *
-json_read_cb (memory_pool_t * pool, gchar * chunk, size_t len, struct map_cb_data *data)
+json_read_cb (memory_pool_t * pool, gchar * chunk, gint len, struct map_cb_data *data)
{
struct json_buf *jb;
size_t free, off;
@@ -137,7 +137,7 @@ json_read_cb (memory_pool_t * pool, gchar * chunk, size_t len, struct map_cb_dat
off = jb->pos - jb->buf;
free = jb->buflen - off;
- if (free < len) {
+ if ((gint)free < len) {
jb->buflen = MAX (jb->buflen * 2, jb->buflen + len * 2);
jb->buf = g_realloc (jb->buf, jb->buflen);
jb->pos = jb->buf + off;
@@ -415,12 +415,12 @@ check_setting (struct worker_task *task, struct rspamd_settings **user_settings,
field ++;
}
len = strcspn (field, ">");
- rspamd_strlcpy (cmp_buf, field, MIN (sizeof (cmp_buf), len + 1));
+ rspamd_strlcpy (cmp_buf, field, MIN ((gint)sizeof (cmp_buf), len + 1));
*user_settings = g_hash_table_lookup (task->cfg->user_settings, cmp_buf);
}
if (domain != NULL) {
len = strcspn (domain, ">");
- rspamd_strlcpy (cmp_buf, domain, MIN (sizeof (cmp_buf), len + 1));
+ rspamd_strlcpy (cmp_buf, domain, MIN ((gint)sizeof (cmp_buf), len + 1));
*domain_settings = g_hash_table_lookup (task->cfg->domain_settings, cmp_buf);
}