mirror of
https://github.com/curl/curl.git
synced 2026-08-26 22:34:45 +03:00
snprintf: renamed and we now only use msnprintf()
The function does not return the same value as snprintf() normally does, so readers may be mislead into thinking the code works differently than it actually does. A different function name makes this easier to detect. Reported-by: Tomas Hoger Assisted-by: Daniel Gustafsson Fixes #3296 Closes #3297
This commit is contained in:
parent
9944d6ba33
commit
dcd6f81025
92 changed files with 632 additions and 631 deletions
|
|
@ -143,7 +143,7 @@ static void auth_digest_md5_to_ascii(unsigned char *source, /* 16 bytes */
|
|||
{
|
||||
int i;
|
||||
for(i = 0; i < 16; i++)
|
||||
snprintf((char *) &dest[i * 2], 3, "%02x", source[i]);
|
||||
msnprintf((char *) &dest[i * 2], 3, "%02x", source[i]);
|
||||
}
|
||||
|
||||
/* Convert sha256 chunk to RFC7616 -suitable ascii string*/
|
||||
|
|
@ -152,7 +152,7 @@ static void auth_digest_sha256_to_ascii(unsigned char *source, /* 32 bytes */
|
|||
{
|
||||
int i;
|
||||
for(i = 0; i < 32; i++)
|
||||
snprintf((char *) &dest[i * 2], 3, "%02x", source[i]);
|
||||
msnprintf((char *) &dest[i * 2], 3, "%02x", source[i]);
|
||||
}
|
||||
|
||||
/* Perform quoted-string escaping as described in RFC2616 and its errata */
|
||||
|
|
@ -432,7 +432,7 @@ CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data,
|
|||
|
||||
/* Convert calculated 16 octet hex into 32 bytes string */
|
||||
for(i = 0; i < MD5_DIGEST_LEN; i++)
|
||||
snprintf(&HA1_hex[2 * i], 3, "%02x", digest[i]);
|
||||
msnprintf(&HA1_hex[2 * i], 3, "%02x", digest[i]);
|
||||
|
||||
/* Generate our SPN */
|
||||
spn = Curl_auth_build_spn(service, realm, NULL);
|
||||
|
|
@ -455,7 +455,7 @@ CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data,
|
|||
Curl_MD5_final(ctxt, digest);
|
||||
|
||||
for(i = 0; i < MD5_DIGEST_LEN; i++)
|
||||
snprintf(&HA2_hex[2 * i], 3, "%02x", digest[i]);
|
||||
msnprintf(&HA2_hex[2 * i], 3, "%02x", digest[i]);
|
||||
|
||||
/* Now calculate the response hash */
|
||||
ctxt = Curl_MD5_init(Curl_DIGEST_MD5);
|
||||
|
|
@ -485,7 +485,7 @@ CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data,
|
|||
Curl_MD5_final(ctxt, digest);
|
||||
|
||||
for(i = 0; i < MD5_DIGEST_LEN; i++)
|
||||
snprintf(&resp_hash_hex[2 * i], 3, "%02x", digest[i]);
|
||||
msnprintf(&resp_hash_hex[2 * i], 3, "%02x", digest[i]);
|
||||
|
||||
/* Generate the response */
|
||||
response = aprintf("username=\"%s\",realm=\"%s\",nonce=\"%s\","
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue