diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-08-04 20:31:24 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-08-04 20:31:24 +0400 |
commit | 3f96e6a7a317e70b85b32de4aa06681c11d79006 (patch) | |
tree | 70343e3fb1a43d29d9c4f454fa47b2dcad6249ad /src/buffer.c | |
parent | 6b86782ce21caad081d41f54ef10233a8e757189 (diff) | |
download | rspamd-3f96e6a7a317e70b85b32de4aa06681c11d79006.tar.gz rspamd-3f96e6a7a317e70b85b32de4aa06681c11d79006.zip |
Fix signness in arithmetic operations.
Diffstat (limited to 'src/buffer.c')
-rw-r--r-- | src/buffer.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/buffer.c b/src/buffer.c index 666869d51..a1f4bee9b 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -101,7 +101,7 @@ sendfile_callback (rspamd_io_dispatcher_t *d) event_add (d->ev, d->tv); } } - else if (r + d->offset < d->file_size) { + else if (r + d->offset < (ssize_t)d->file_size) { debug_ip("partially write data, retry"); /* Wait for other event */ event_del (d->ev); @@ -334,7 +334,7 @@ read_buffers (gint fd, rspamd_io_dispatcher_t * d, gboolean skip_read) * c - pointer to current position (buffer->begin + r) * res - result string */ - while (r < len) { + while (r < (ssize_t)len) { if (*c == '\n') { res.begin = b; res.len = c - b; @@ -389,7 +389,7 @@ read_buffers (gint fd, rspamd_io_dispatcher_t * d, gboolean skip_read) break; case BUFFER_CHARACTER: r = d->nchars; - if (len >= r) { + if ((ssize_t)len >= r) { res.begin = b; res.len = r; c = b + r; @@ -398,7 +398,7 @@ read_buffers (gint fd, rspamd_io_dispatcher_t * d, gboolean skip_read) return; } /* Move remaining string to begin of buffer (draining) */ - if (len > r) { + if ((ssize_t)len > r) { len -= r; memmove (d->in_buf->data->begin, c, len); d->in_buf->data->len = len; @@ -409,7 +409,7 @@ read_buffers (gint fd, rspamd_io_dispatcher_t * d, gboolean skip_read) d->in_buf->data->len = 0; d->in_buf->pos = d->in_buf->data->begin; } - if (d->policy != saved_policy && len != r) { + if (d->policy != saved_policy && (ssize_t)len != r) { debug_ip("policy changed during callback, restart buffer's processing"); read_buffers (fd, d, TRUE); return; |