src: stop overriding system printf symbols

Also:
- tool_operate: use the socket printf mask, drop cast.

Follow-up to 4deea9396b #18814

Closes #18844
This commit is contained in:
Viktor Szakats 2025-10-04 12:24:57 +02:00
parent 34ad78da89
commit db98daab05
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
25 changed files with 203 additions and 207 deletions

View file

@ -751,8 +751,8 @@ static CURLcode set_trace_config(const char *token)
}
else {
char buffer[64];
msnprintf(buffer, sizeof(buffer), "%c%.*s,-lib-ids", toggle ? '+' : '-',
(int)len, name);
curl_msnprintf(buffer, sizeof(buffer), "%c%.*s,-lib-ids",
toggle ? '+' : '-', (int)len, name);
result = curl_global_trace(buffer);
if(result)
goto out;
@ -1140,7 +1140,7 @@ static ParameterError parse_localport(struct OperationConfig *config,
if(ISBLANK(*pp))
pp++;
}
msnprintf(buffer, sizeof(buffer), "%.*s", (int)plen, nextarg);
curl_msnprintf(buffer, sizeof(buffer), "%.*s", (int)plen, nextarg);
if(str2unummax(&config->localport, buffer, 65535))
return PARAM_BAD_USE;
if(!pp)
@ -1222,7 +1222,7 @@ static ParameterError parse_ech(struct OperationConfig *config,
curlx_fclose(file);
if(err)
return err;
config->ech_config = aprintf("ecl:%s",tmpcfg);
config->ech_config = curl_maprintf("ecl:%s",tmpcfg);
free(tmpcfg);
if(!config->ech_config)
return PARAM_NO_MEM;
@ -1405,8 +1405,8 @@ static ParameterError parse_range(struct OperationConfig *config,
char buffer[32];
warnf("A specified range MUST include at least one dash (-). "
"Appending one for you");
msnprintf(buffer, sizeof(buffer), "%" CURL_FORMAT_CURL_OFF_T "-",
value);
curl_msnprintf(buffer, sizeof(buffer), "%" CURL_FORMAT_CURL_OFF_T "-",
value);
free(config->range);
config->range = strdup(buffer);
if(!config->range)