From 625eba7d0fc0df4a1508a210fe0be19da306b2eb Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Sun, 4 Oct 2015 15:34:48 +0100 Subject: [PATCH] Ecore pipe: clean up handling of already read information. Coverity was complaining about a possible integer overflow. This isn't actually possible, but coverity has no way to know that because we were in fact using a too big of a type. I fixed it to be the right type so now everything should work. CID 98384 @fix --- src/lib/ecore/ecore_pipe.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/ecore/ecore_pipe.c b/src/lib/ecore/ecore_pipe.c index ba6c32bf3f..ac000a6ada 100644 --- a/src/lib/ecore/ecore_pipe.c +++ b/src/lib/ecore/ecore_pipe.c @@ -92,7 +92,7 @@ struct _Ecore_Pipe Ecore_Pipe_Cb handler; unsigned int len; int handling; - size_t already_read; + unsigned int already_read; void *passed_data; int message; Eina_Bool delete_me : 1; @@ -656,12 +656,12 @@ _ecore_pipe_read(void *data, /* catch the non error case first */ /* if we read enough data to finish the message/buffer */ - if (ret == (ssize_t)(p->len - p->already_read)) + if (ret == (p->len - p->already_read)) _ecore_pipe_handler_call(p, p->passed_data, p->len); else if (ret > 0) { /* more data left to read */ - p->already_read += ret; + p->already_read += (unsigned int) ret; _ecore_pipe_unhandle(p); return ECORE_CALLBACK_RENEW; }