lib: add a Curl_bufref_uptr() function and use it

Function Curl_bufref_ptr() now returns a const char *.
New function Curl_bufref_uptr() returns a const unsigned char *.

Usage and doc updated.

Closes #19827
This commit is contained in:
Patrick Monnerat 2025-12-03 18:36:03 +01:00 committed by Daniel Stenberg
parent 39d1976b7f
commit f39b8a1174
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
13 changed files with 40 additions and 23 deletions

View file

@ -623,7 +623,7 @@ static CURLcode pop3_perform_auth(struct Curl_easy *data,
struct pop3_conn *pop3c =
Curl_conn_meta_get(data->conn, CURL_META_POP3_CONN);
CURLcode result = CURLE_OK;
const char *ir = (const char *)Curl_bufref_ptr(initresp);
const char *ir = Curl_bufref_ptr(initresp);
if(!pop3c)
return CURLE_FAILED_INIT;
@ -657,8 +657,7 @@ static CURLcode pop3_continue_auth(struct Curl_easy *data,
if(!pop3c)
return CURLE_FAILED_INIT;
return Curl_pp_sendf(data, &pop3c->pp,
"%s", (const char *) Curl_bufref_ptr(resp));
return Curl_pp_sendf(data, &pop3c->pp, "%s", Curl_bufref_ptr(resp));
}
/***********************************************************************