mirror of
https://github.com/curl/curl.git
synced 2026-01-26 06:57:57 +00:00
build: constify memchr()/strchr()/etc result variables (cont.)
Assisted-by: Rudi Heitbaum Fixes #20420 Follow-up to 7dc60bdb90c710c2e36b2d05aa3686ff491a9bbe #20425 Follow-up to 0e2507a3c65376d6bda860ff20bd94ada9bbb9fd #20421 Closes #20428
This commit is contained in:
parent
6974bd7cc8
commit
4e5908306a
@ -136,7 +136,7 @@ static CURLcode sendf(struct Curl_easy *data, const char *fmt, ...)
|
|||||||
|
|
||||||
static CURLcode dict_do(struct Curl_easy *data, bool *done)
|
static CURLcode dict_do(struct Curl_easy *data, bool *done)
|
||||||
{
|
{
|
||||||
const char *word;
|
char *word;
|
||||||
char *eword = NULL;
|
char *eword = NULL;
|
||||||
char *ppath;
|
char *ppath;
|
||||||
char *database = NULL;
|
char *database = NULL;
|
||||||
|
|||||||
@ -69,7 +69,7 @@ CURLcode Curl_output_digest(struct Curl_easy *data,
|
|||||||
{
|
{
|
||||||
CURLcode result;
|
CURLcode result;
|
||||||
unsigned char *path = NULL;
|
unsigned char *path = NULL;
|
||||||
char *tmp = NULL;
|
const char *tmp = NULL;
|
||||||
char *response;
|
char *response;
|
||||||
size_t len;
|
size_t len;
|
||||||
bool have_chlg;
|
bool have_chlg;
|
||||||
|
|||||||
@ -116,7 +116,7 @@ CURLcode add_file_name_to_url(CURL *curl, char **inurlp, const char *filename)
|
|||||||
/* We only want the part of the local path that is on the right
|
/* We only want the part of the local path that is on the right
|
||||||
side of the rightmost slash and backslash. */
|
side of the rightmost slash and backslash. */
|
||||||
const char *filep = strrchr(filename, '/');
|
const char *filep = strrchr(filename, '/');
|
||||||
char *file2 = strrchr(filep ? filep : filename, '\\');
|
const char *file2 = strrchr(filep ? filep : filename, '\\');
|
||||||
char *encfile;
|
char *encfile;
|
||||||
|
|
||||||
if(file2)
|
if(file2)
|
||||||
|
|||||||
@ -352,7 +352,7 @@ static CURLcode peek_ipv6(const char *str, size_t *skip, bool *ipv6p)
|
|||||||
*/
|
*/
|
||||||
char hostname[MAX_IP6LEN];
|
char hostname[MAX_IP6LEN];
|
||||||
CURLU *u;
|
CURLU *u;
|
||||||
char *endbr = strchr(str, ']');
|
const char *endbr = strchr(str, ']');
|
||||||
size_t hlen;
|
size_t hlen;
|
||||||
CURLUcode rc;
|
CURLUcode rc;
|
||||||
CURLcode result = CURLE_OK;
|
CURLcode result = CURLE_OK;
|
||||||
|
|||||||
@ -734,10 +734,10 @@ void ourWriteOut(struct OperationConfig *config, struct per_transfer *per,
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* this is meant as a variable to output */
|
/* this is meant as a variable to output */
|
||||||
char *end;
|
const char *end;
|
||||||
size_t vlen;
|
size_t vlen;
|
||||||
if('{' == ptr[1]) {
|
if('{' == ptr[1]) {
|
||||||
struct writeoutvar *wv = NULL;
|
const struct writeoutvar *wv = NULL;
|
||||||
struct writeoutvar find = { 0 };
|
struct writeoutvar find = { 0 };
|
||||||
end = strchr(ptr, '}');
|
end = strchr(ptr, '}');
|
||||||
ptr += 2; /* pass the % and the { */
|
ptr += 2; /* pass the % and the { */
|
||||||
|
|||||||
@ -1185,7 +1185,7 @@ static CURLUcode updateurl(CURLU *u, const char *cmd, unsigned int setflags)
|
|||||||
|
|
||||||
/* make sure the last command ends with a comma too! */
|
/* make sure the last command ends with a comma too! */
|
||||||
while(p) {
|
while(p) {
|
||||||
char *e = strchr(p, ',');
|
const char *e = strchr(p, ',');
|
||||||
if(e) {
|
if(e) {
|
||||||
size_t n = (size_t)(e - p);
|
size_t n = (size_t)(e - p);
|
||||||
char buf[80];
|
char buf[80];
|
||||||
|
|||||||
@ -491,7 +491,7 @@ static int sws_ProcessRequest(struct sws_httprequest *req)
|
|||||||
|
|
||||||
if(req->testno == DOCNUMBER_NOTHING) {
|
if(req->testno == DOCNUMBER_NOTHING) {
|
||||||
/* check for a Testno: header with the test case number */
|
/* check for a Testno: header with the test case number */
|
||||||
char *testno = strstr(line, "\nTestno: ");
|
const char *testno = strstr(line, "\nTestno: ");
|
||||||
if(testno) {
|
if(testno) {
|
||||||
pval = &testno[9];
|
pval = &testno[9];
|
||||||
if(!curlx_str_number(&pval, &num, INT_MAX)) {
|
if(!curlx_str_number(&pval, &num, INT_MAX)) {
|
||||||
@ -596,7 +596,7 @@ static int sws_ProcessRequest(struct sws_httprequest *req)
|
|||||||
return 1; /* done */
|
return 1; /* done */
|
||||||
}
|
}
|
||||||
else if(strstr(req->reqbuf, "\r\n0\r\n")) {
|
else if(strstr(req->reqbuf, "\r\n0\r\n")) {
|
||||||
char *last_crlf_char = strstr(req->reqbuf, "\r\n\r\n");
|
const char *last_crlf_char = strstr(req->reqbuf, "\r\n\r\n");
|
||||||
while(TRUE) {
|
while(TRUE) {
|
||||||
if(!strstr(last_crlf_char + 4, "\r\n\r\n"))
|
if(!strstr(last_crlf_char + 4, "\r\n\r\n"))
|
||||||
break;
|
break;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user