mirror of
https://github.com/curl/curl.git
synced 2026-07-28 21:23:06 +03:00
src: replace strto[u][ld] with curlx_str_ parsers
- Better error handling (no errno mess), better limit checks. - Also removed all uses of curlx_strtoofft() Closes #16634
This commit is contained in:
parent
f3b599a7e2
commit
8dca3b0656
12 changed files with 150 additions and 205 deletions
|
|
@ -133,10 +133,10 @@ static void memory_tracking_init(void)
|
|||
/* if CURL_MEMLIMIT is set, this enables fail-on-alloc-number-N feature */
|
||||
env = curl_getenv("CURL_MEMLIMIT");
|
||||
if(env) {
|
||||
char *endptr;
|
||||
long num = strtol(env, &endptr, 10);
|
||||
if((endptr != env) && (endptr == env + strlen(env)) && (num > 0))
|
||||
curl_dbg_memlimit(num);
|
||||
curl_off_t num;
|
||||
const char *p = env;
|
||||
if(!curlx_str_number(&p, &num, LONG_MAX))
|
||||
curl_dbg_memlimit((long)num);
|
||||
curl_free(env);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue