mirror of
https://github.com/curl/curl.git
synced 2026-08-10 07:50:54 +03:00
curlx_base64_encode: use uint8_t* for input
Change `inputbuff` parameter from `const char *` to `const uint8_t *` to reflect the binary nature of the input bytes. Half the code was casting unsigned char to signed already in calling. Closes #19722
This commit is contained in:
parent
fd5a117a67
commit
bbb929112b
19 changed files with 33 additions and 30 deletions
|
|
@ -133,7 +133,7 @@ static CURLcode test_unit1302(const char *arg)
|
|||
size_t dlen;
|
||||
|
||||
/* first encode */
|
||||
rc = curlx_base64_encode(e->input, e->ilen, &out, &olen);
|
||||
rc = curlx_base64_encode((const uint8_t *)e->input, e->ilen, &out, &olen);
|
||||
abort_unless(rc == CURLE_OK, "return code should be CURLE_OK");
|
||||
abort_unless(olen == e->olen, "wrong output size");
|
||||
if(memcmp(out, e->output, e->olen)) {
|
||||
|
|
@ -166,7 +166,8 @@ static CURLcode test_unit1302(const char *arg)
|
|||
struct etest *e = &url[i];
|
||||
char *out;
|
||||
size_t olen;
|
||||
rc = curlx_base64url_encode(e->input, e->ilen, &out, &olen);
|
||||
rc = curlx_base64url_encode((const uint8_t *)e->input, e->ilen,
|
||||
&out, &olen);
|
||||
abort_unless(rc == CURLE_OK, "return code should be CURLE_OK");
|
||||
if(olen != e->olen) {
|
||||
curl_mfprintf(stderr, "Test %u URL encoded output length %zu "
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue