mirror of
https://github.com/curl/curl.git
synced 2026-08-26 05:43:31 +03:00
atoi: remove atoi usage
This commit is contained in:
parent
cbe67a1b71
commit
5db0a412ff
12 changed files with 36 additions and 22 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue