aboutsummaryrefslogtreecommitdiff
path: root/tests/server/sws.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/server/sws.c')
-rw-r--r--tests/server/sws.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/server/sws.c b/tests/server/sws.c
index 1650226e6..65a61c2ce 100644
--- a/tests/server/sws.c
+++ b/tests/server/sws.c
@@ -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;
}