mirror of
https://github.com/curl/curl.git
synced 2026-04-14 22:41:40 +03:00
build: constify memchr()/strchr()/etc result variables
And a few variables around. There remain cases where the accepted pointer is const, yet the returned pointer is written to. Partly addressing (glibc 2.43): ``` * For ISO C23, the functions bsearch, memchr, strchr, strpbrk, strrchr, strstr, wcschr, wcspbrk, wcsrchr, wcsstr and wmemchr that return pointers into their input arrays now have definitions as macros that return a pointer to a const-qualified type when the input argument is a pointer to a const-qualified type. ``` Ref: https://lists.gnu.org/archive/html/info-gnu/2026-01/msg00005.html Reported-by: Rudi Heitbaum Ref: #20420 Closes #20421
This commit is contained in:
parent
7dc60bdb90
commit
0e2507a3c6
22 changed files with 54 additions and 53 deletions
|
|
@ -122,7 +122,7 @@ static NETRCcode parsenetrc(struct store_netrc *store,
|
|||
any order */
|
||||
bool our_login = FALSE; /* found our login name */
|
||||
bool done = FALSE;
|
||||
char *netrcbuffer;
|
||||
const char *netrcbuffer;
|
||||
struct dynbuf token;
|
||||
struct dynbuf *filebuf = &store->filebuf;
|
||||
DEBUGASSERT(!*passwordp);
|
||||
|
|
@ -326,7 +326,7 @@ static NETRCcode parsenetrc(struct store_netrc *store,
|
|||
tok = ++tok_end;
|
||||
}
|
||||
if(!done) {
|
||||
char *nl = NULL;
|
||||
const char *nl = NULL;
|
||||
if(tok)
|
||||
nl = strchr(tok, '\n');
|
||||
if(!nl)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue