aboutsummaryrefslogtreecommitdiffstats
path: root/lib
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 /lib
parent6b86782ce21caad081d41f54ef10233a8e757189 (diff)
downloadrspamd-3f96e6a7a317e70b85b32de4aa06681c11d79006.tar.gz
rspamd-3f96e6a7a317e70b85b32de4aa06681c11d79006.zip
Fix signness in arithmetic operations.
Diffstat (limited to 'lib')
-rw-r--r--lib/librspamdclient.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/librspamdclient.c b/lib/librspamdclient.c
index e871c29f6..69c6edca8 100644
--- a/lib/librspamdclient.c
+++ b/lib/librspamdclient.c
@@ -439,7 +439,7 @@ parse_rspamd_metric_line (struct rspamd_connection *conn, guint len, GError **er
case 1:
/* Read boolean result */
if (*p == ';') {
- if (p - c >= sizeof("Skip")) {
+ if (p - c >= (gint)sizeof("Skip")) {
if (memcmp (c, "Skip", p - c - 1) == 0) {
new->is_skipped = TRUE;
}
@@ -879,12 +879,12 @@ read_rspamd_reply_line (struct rspamd_connection *c, GError **err)
/* Try to obtain string from the input buffer */
if (c->in_buf->len > 0) {
len = 0;
- while (len < c->in_buf->len) {
+ while (len < (gint)c->in_buf->len) {
p = c->in_buf->str[len];
if (p == '\r' || p == '\n') {
if (parse_rspamd_reply_line (c, len, err)) {
/* Strip '\r\n' */
- while (len < c->in_buf->len && (p == '\r' || p == '\n')) {
+ while (len < (gint)c->in_buf->len && (p == '\r' || p == '\n')) {
p = c->in_buf->str[++len];
}
/* Move remaining buffer to the begin of string */
@@ -1116,7 +1116,7 @@ rspamd_send_controller_command (struct rspamd_connection *c, const gchar *line,
}
if ((r = read (c->socket, tmpbuf, sizeof (tmpbuf))) > 0) {
/* Check the end of the buffer for END marker */
- if (r >= sizeof (end_marker) - 1 &&
+ if (r >= (gint)sizeof (end_marker) - 1 &&
memcmp (tmpbuf + r - sizeof (end_marker) + 1, end_marker, sizeof (end_marker) - 1) == 0) {
r -= sizeof (end_marker) - 1;
/* Copy the rest to the result string */
@@ -1204,7 +1204,7 @@ rspamd_read_controller_greeting (struct rspamd_connection *c, GError **err)
return FALSE;
}
if ((r = read (c->socket, inbuf, sizeof (inbuf))) > 0) {
- if (r >= sizeof (greeting_str) - 1 &&
+ if (r >= (gint)sizeof (greeting_str) - 1 &&
memcmp (inbuf, greeting_str, sizeof (greeting_str) - 1) == 0) {
return TRUE;
}