From 504df2e31857166e277a1ef614c397c976b84807 Mon Sep 17 00:00:00 2001 From: angt Date: Wed, 28 Oct 2015 16:27:55 +0100 Subject: [PATCH] Make GCC happy --- glorytun.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/glorytun.c b/glorytun.c index 061786c..41f5205 100644 --- a/glorytun.c +++ b/glorytun.c @@ -456,7 +456,7 @@ int main (int argc, char **argv) fds[0].events = POLLIN; struct iovec iov[16]; - int count; + size_t count; uint8_t *data = sock.recv.read; @@ -467,10 +467,7 @@ int main (int argc, char **argv) if (!ip_size) goto restart; - if (ip_size==-1) - break; - - if (ip_size>size) + if (ip_size<0 || (size_t)ip_size>size) break; iov[count].iov_base = data;