lib: fix formatting nits (part 3)

From `lib/h` to `lib/w`.

part 1: 47a1ab2ebe #19764
part 2: 86b346443b #19800

Closes #19811
This commit is contained in:
Viktor Szakats 2025-12-02 07:25:18 +01:00
parent dc8c0d54a5
commit c3b030b860
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
102 changed files with 2001 additions and 2226 deletions

View file

@ -227,8 +227,7 @@ CURLcode Curl_rand_bytes(struct Curl_easy *data,
* size.
*/
CURLcode Curl_rand_hex(struct Curl_easy *data, unsigned char *rnd,
size_t num)
CURLcode Curl_rand_hex(struct Curl_easy *data, unsigned char *rnd, size_t num)
{
CURLcode result = CURLE_BAD_FUNCTION_ARGUMENT;
unsigned char buffer[128];
@ -240,7 +239,7 @@ CURLcode Curl_rand_hex(struct Curl_easy *data, unsigned char *rnd,
memset(buffer, 0, sizeof(buffer));
#endif
if((num/2 >= sizeof(buffer)) || !(num&1)) {
if((num / 2 >= sizeof(buffer)) || !(num & 1)) {
/* make sure it fits in the local buffer and that it is an odd number! */
DEBUGF(infof(data, "invalid buffer size with Curl_rand_hex"));
return CURLE_BAD_FUNCTION_ARGUMENT;
@ -248,11 +247,11 @@ CURLcode Curl_rand_hex(struct Curl_easy *data, unsigned char *rnd,
num--; /* save one for null-termination */
result = Curl_rand(data, buffer, num/2);
result = Curl_rand(data, buffer, num / 2);
if(result)
return result;
Curl_hexencode(buffer, num/2, rnd, num + 1);
Curl_hexencode(buffer, num / 2, rnd, num + 1);
return result;
}