Tools: add -Wall -Werror and fix tunslip6 warnings

This commit is contained in:
Simon Duquennoy 2017-11-17 13:32:08 -08:00
parent bd152ad21f
commit cfb895923a
3 changed files with 7 additions and 3 deletions

View File

@ -1,5 +1,7 @@
all: tunslip6
CFLAGS += -Wall -Werror
tunslip6: tools-utils.c tunslip6.c
gitclean:

View File

@ -21,5 +21,7 @@ endif
all: $(SERIALDUMP)
CFLAGS += -Wall -Werror
$(SERIALDUMP): serialdump.c
$(CC) -O2 -o $@ $<

View File

@ -40,6 +40,7 @@
#include <stdarg.h>
#include <string.h>
#include <time.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
@ -683,7 +684,7 @@ ifconf(const char *tundev, const char *ipaddr)
}
ai=0;
cc=scc=0;
while(c=*ptr++) {
while((c=*ptr++) != 0) {
if(c=='/') break;
if(c==':') {
if(cc)
@ -1025,9 +1026,8 @@ exit(1);
if(dmsec>delaymsec) delaymsec=0;
}
if(delaymsec==0) {
int size;
if(slip_empty() && FD_ISSET(tunfd, &rset)) {
size=tun_to_serial(tunfd, slipfd);
tun_to_serial(tunfd, slipfd);
slip_flushbuf(slipfd);
if(ipa_enable) sigalarm_reset();
if(basedelay) {