atoi: remove atoi usage

This commit is contained in:
Yang Tse 2010-11-28 23:11:14 +01:00
parent cbe67a1b71
commit 5db0a412ff
12 changed files with 36 additions and 22 deletions

View file

@ -531,8 +531,8 @@ static int ProcessRequest(struct httprequest *req)
/* if the host name starts with test, the port number used in the
CONNECT line will be used as test number! */
char *portp = strchr(doc, ':');
if(portp)
req->testno = atoi(portp+1);
if(portp && (*(portp+1) != '\0') && ISDIGIT(*(portp+1)))
req->testno = strtol(portp+1, NULL, 10);
else
req->testno = DOCNUMBER_CONNECT;
}

View file

@ -467,8 +467,8 @@ static int ProcessRequest(struct httprequest *req)
/* if the host name starts with test, the port number used in the
CONNECT line will be used as test number! */
char *portp = strchr(doc, ':');
if(portp)
req->testno = atoi(portp+1);
if(portp && (*(portp+1) != '\0') && ISDIGIT(*(portp+1)))
req->testno = strtol(portp+1, NULL, 10);
else
req->testno = DOCNUMBER_CONNECT;
}