Remove a few signed/unsigned compares

This commit is contained in:
Thomas Bernard 2012-05-08 23:10:25 +02:00
parent 0ed9e08792
commit bf0e1c509e
3 changed files with 8 additions and 6 deletions

View File

@ -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.

View File

@ -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 */

View File

@ -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);