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:
Daniel Stenberg 2025-03-09 12:49:24 +01:00
parent f3b599a7e2
commit 8dca3b0656
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
12 changed files with 150 additions and 205 deletions

View file

@ -930,9 +930,10 @@ static CURLcode config2setopts(struct GlobalConfig *global,
#ifdef DEBUGBUILD
char *env = getenv("CURL_BUFFERSIZE");
if(env) {
long size = strtol(env, NULL, 10);
if(size)
my_setopt(curl, CURLOPT_BUFFERSIZE, size);
curl_off_t num;
const char *p = env;
if(!Curl_str_number(&p, &num, LONG_MAX))
my_setopt(curl, CURLOPT_BUFFERSIZE, (long)num);
}
else
#endif