diff options
author | Yang Tse <yangsita@gmail.com> | 2011-07-27 20:10:02 +0200 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2011-07-27 20:10:02 +0200 |
commit | dddf9aa610b32a6b7aa304826dbf962c951e2203 (patch) | |
tree | bc3ac2484bf78760f190b78c748805edd25b37a1 /tests | |
parent | 4eb08ac1c005cfc1ea7e09d5e10697bab08e3cac (diff) | |
download | curl-dddf9aa610b32a6b7aa304826dbf962c951e2203.tar.gz |
NTLM single-sign on adjustments (IV)
Fix compiler warning
Diffstat (limited to 'tests')
-rw-r--r-- | tests/server/fake_ntlm.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/server/fake_ntlm.c b/tests/server/fake_ntlm.c index 9ce8436ef..686264b1e 100644 --- a/tests/server/fake_ntlm.c +++ b/tests/server/fake_ntlm.c @@ -58,7 +58,7 @@ int main(int argc, char *argv[]) char *type1_input = NULL, *type3_input = NULL; char *type1_output = NULL, *type3_output = NULL; size_t size = 0; - int testnum; + long testnum; const char *env; int arg = 1; char *helper_user = (char *)"unknown"; @@ -98,7 +98,13 @@ int main(int argc, char *argv[]) env = getenv("NTLM_AUTH_TESTNUM"); if (env) { - testnum = strtoul(env, NULL, 10); + char *endptr; + long lnum = strtol(env, &endptr, 10); + if((endptr != env + strlen(env)) || (lnum < 1L)) { + logmsg("Test number not valid in NTLM_AUTH_TESTNUM"); + exit(1); + } + testnum = lnum; } else { logmsg("Test number not specified in NTLM_AUTH_TESTNUM"); exit(1); |