From 24f9f109c1ed4e2f6a97e010a8f3207d71a1b6eb Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Jan 2016 13:59:32 -0300 Subject: [PATCH] test --- iguana/SuperNET.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/iguana/SuperNET.c b/iguana/SuperNET.c index 0dd3cdb29..131310b8f 100644 --- a/iguana/SuperNET.c +++ b/iguana/SuperNET.c @@ -449,9 +449,12 @@ void SuperNET_loop(void *args) void SuperNET_init(struct supernet_info *myinfo,uint16_t PUBport,uint16_t LBport) { - int32_t sendtimeout,recvtimeout; int64_t allocsize; char *ipaddr; + int32_t sendtimeout,recvtimeout,len,c; int64_t allocsize; char *ipaddr; if ( (ipaddr = OS_filestr(&allocsize,"myipaddr")) != 0 ) { + len = (int32_t)strlen(ipaddr) - 1; + while ( len > 8 && ((c= ipaddr[len]) == '\r' || c == '\n' || c == ' ' || c == '\t') ) + ipaddr[len] = 0, len--; if ( is_ipaddr(ipaddr) != 0 ) strcpy(myinfo->ipaddr,ipaddr); free(ipaddr), ipaddr = 0;