From ae6e4f68f37333e3dbd6b8b89445850b87bcbfe2 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Thu, 12 Mar 2009 16:33:14 -0300 Subject: Fix a couple of other places that should use size_t and ssize_t --- compat/bnep.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'compat') diff --git a/compat/bnep.c b/compat/bnep.c index e9742c7aa..0498c789f 100644 --- a/compat/bnep.c +++ b/compat/bnep.c @@ -219,7 +219,7 @@ int bnep_accept_connection(int sk, uint16_t role, char *dev) struct bnep_setup_conn_req *req; struct bnep_control_rsp *rsp; unsigned char pkt[BNEP_MTU]; - int r; + ssize_t r; r = recv(sk, pkt, BNEP_MTU, 0); if (r <= 0) @@ -227,7 +227,7 @@ int bnep_accept_connection(int sk, uint16_t role, char *dev) errno = EPROTO; - if (r < (int) sizeof(*req)) + if ((size_t) r < sizeof(*req)) return -1; req = (void *) pkt; @@ -259,7 +259,7 @@ int bnep_create_connection(int sk, uint16_t role, uint16_t svc, char *dev) struct __service_16 *s; struct timeval timeo; unsigned char pkt[BNEP_MTU]; - int r; + ssize_t r; /* Send request */ req = (void *) pkt; @@ -292,9 +292,9 @@ receive: errno = EPROTO; - if (r < (int) sizeof(*rsp)) + if ((size_t) r < sizeof(*rsp)) return -1; - + rsp = (void *) pkt; if (rsp->type != BNEP_CONTROL) return -1; -- cgit v1.2.3