mirror of
https://github.com/curl/curl.git
synced 2025-01-30 14:22:33 +08:00
lib: fix maybe-uninitialized warnings
With -Og, GCC complains: easy.c:628:7: error: ‘mcode’ may be used uninitialized in this function [-Werror=maybe-uninitialized] ../lib/strcase.h:35:29: error: ‘tok_buf’ may be used uninitialized in this function [-Werror=maybe-uninitialized] vauth/digest.c:208:9: note: ‘tok_buf’ was declared here ../lib/strcase.h:35:29: error: ‘tok_buf’ may be used uninitialized in this function [-Werror=maybe-uninitialized] vauth/digest.c:566:15: note: ‘tok_buf’ was declared here Fix this by initializing the variables.
This commit is contained in:
parent
f761da76f6
commit
4a8cf6c404
@ -561,7 +561,7 @@ static void events_setup(struct Curl_multi *multi, struct events *ev)
|
|||||||
static CURLcode wait_or_timeout(struct Curl_multi *multi, struct events *ev)
|
static CURLcode wait_or_timeout(struct Curl_multi *multi, struct events *ev)
|
||||||
{
|
{
|
||||||
bool done = FALSE;
|
bool done = FALSE;
|
||||||
CURLMcode mcode;
|
CURLMcode mcode = CURLM_OK;
|
||||||
CURLcode result = CURLE_OK;
|
CURLcode result = CURLE_OK;
|
||||||
|
|
||||||
while(!done) {
|
while(!done) {
|
||||||
|
@ -205,7 +205,7 @@ static CURLcode auth_digest_get_qop_values(const char *options, int *value)
|
|||||||
{
|
{
|
||||||
char *tmp;
|
char *tmp;
|
||||||
char *token;
|
char *token;
|
||||||
char *tok_buf;
|
char *tok_buf = NULL;
|
||||||
|
|
||||||
/* Initialise the output */
|
/* Initialise the output */
|
||||||
*value = 0;
|
*value = 0;
|
||||||
@ -563,7 +563,7 @@ CURLcode Curl_auth_decode_digest_http_message(const char *chlg,
|
|||||||
return CURLE_OUT_OF_MEMORY;
|
return CURLE_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
else if(strcasecompare(value, "qop")) {
|
else if(strcasecompare(value, "qop")) {
|
||||||
char *tok_buf;
|
char *tok_buf = NULL;
|
||||||
/* Tokenize the list and choose auth if possible, use a temporary
|
/* Tokenize the list and choose auth if possible, use a temporary
|
||||||
clone of the buffer since strtok_r() ruins it */
|
clone of the buffer since strtok_r() ruins it */
|
||||||
tmp = strdup(content);
|
tmp = strdup(content);
|
||||||
|
Loading…
Reference in New Issue
Block a user