aboutsummaryrefslogtreecommitdiff
path: root/tests/libtest/first.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2010-11-28 23:11:14 +0100
committerYang Tse <yangsita@gmail.com>2010-11-28 23:11:14 +0100
commit5db0a412ff6972e51ccddaf1e8d6a27c8de4990f (patch)
tree8c8cfa609c25c68929554ac1e24eaa4084683152 /tests/libtest/first.c
parentcbe67a1b71f7098779b8c0cecccb60382cec2d20 (diff)
atoi: remove atoi usage
Diffstat (limited to 'tests/libtest/first.c')
-rw-r--r--tests/libtest/first.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/libtest/first.c b/tests/libtest/first.c
index 770f9d527..a0e713f48 100644
--- a/tests/libtest/first.c
+++ b/tests/libtest/first.c
@@ -59,7 +59,10 @@ int main(int argc, char **argv)
/* this enables the fail-on-alloc-number-N functionality */
env = curl_getenv("CURL_MEMLIMIT");
if(env) {
- curl_memlimit(atoi(env));
+ char *endptr;
+ long num = strtol(env, &endptr, 10);
+ if((endptr != env) && (endptr == env + strlen(env)) && (num > 0))
+ curl_memlimit(num);
curl_free(env);
}
#endif