From bf0e1c509e9062955635d0a8aec2378f8d3feddd Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Tue, 8 May 2012 23:10:25 +0200 Subject: [PATCH] Remove a few signed/unsigned compares --- minissdpd/Changelog.txt | 1 + minissdpd/minissdpd.c | 9 +++++---- minissdpd/testminissdpd.c | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/minissdpd/Changelog.txt b/minissdpd/Changelog.txt index 4dca8ae..4c5ac27 100644 --- a/minissdpd/Changelog.txt +++ b/minissdpd/Changelog.txt @@ -2,6 +2,7 @@ $Id: Changelog.txt,v 1.25 2012/05/02 10:30:40 nanard Exp $ 2012/05/02: Clean CLFAGS in Makefile. + Remove a few signed/unsigned compares 2012/04/09: Added -ansi to compilation flags. diff --git a/minissdpd/minissdpd.c b/minissdpd/minissdpd.c index 38ae03c..7f241da 100644 --- a/minissdpd/minissdpd.c +++ b/minissdpd/minissdpd.c @@ -1,4 +1,4 @@ -/* $Id: minissdpd.c,v 1.30 2012/04/09 21:50:18 nanard Exp $ */ +/* $Id: minissdpd.c,v 1.31 2012/05/02 10:28:25 nanard Exp $ */ /* MiniUPnP project * (c) 2007-2012 Thomas Bernard * website : http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ @@ -573,12 +573,13 @@ void processRequest(struct reqelem * req) } else { /* test if we can put more responses in the buffer */ if(d->headers[HEADER_LOCATION].l + d->headers[HEADER_NT].l - + d->headers[HEADER_USN].l + 6 + (rp - rbuf) >= sizeof(rbuf)) - break; + + d->headers[HEADER_USN].l + 6 + + (rp - rbuf) >= (int)sizeof(rbuf)) + break; if( (type==1 && 0==memcmp(d->headers[HEADER_NT].p, p, l)) ||(type==2 && 0==memcmp(d->headers[HEADER_USN].p, p, l)) ||(type==3) ) { - /* response : + /* response : * 1 - Location * 2 - NT (device/service type) * 3 - usn */ diff --git a/minissdpd/testminissdpd.c b/minissdpd/testminissdpd.c index 657e78e..c06cf50 100644 --- a/minissdpd/testminissdpd.c +++ b/minissdpd/testminissdpd.c @@ -1,4 +1,4 @@ -/* $Id: testminissdpd.c,v 1.6 2007/12/19 14:49:30 nanard Exp $ */ +/* $Id: testminissdpd.c,v 1.7 2012/05/02 10:28:25 nanard Exp $ */ /* Project : miniupnp * website : http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ * Author : Thomas BERNARD @@ -26,7 +26,7 @@ void printresponse(const unsigned char * resp, int n) printf("\n"); nresp = resp[0]; p = resp + 1; - for(i = 0; i < nresp; i++) { + for(i = 0; i < (int)nresp; i++) { /*l = *(p++);*/ DECODELENGTH(l, p); printf("%d - %.*s\n", i, l, p);