1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

ftp/imap/pop3/smtp: Fixed compilation warning when /Wall enabled

warning C4706: assignment within conditional expression
This commit is contained in:
Steve Holme 2016-03-19 17:15:53 +00:00
parent 4ff2fbd1d5
commit c142e73142
5 changed files with 18 additions and 14 deletions

View File

@ -1300,11 +1300,13 @@ CURLcode Curl_sasl_parse_url_auth_option(struct SASL *sasl,
if(strnequal(value, "*", len))
sasl->prefmech = SASL_AUTH_DEFAULT;
else if((mechbit = Curl_sasl_decode_mech(value, len, &mechlen)) &&
mechlen == len)
sasl->prefmech |= mechbit;
else
result = CURLE_URL_MALFORMAT;
else {
mechbit = Curl_sasl_decode_mech(value, len, &mechlen);
if(mechbit && mechlen == len)
sasl->prefmech |= mechbit;
else
result = CURLE_URL_MALFORMAT;
}
return result;
}
@ -1600,7 +1602,8 @@ CURLcode Curl_sasl_continue(struct SASL *sasl, struct connectdata *conn,
newstate = SASL_DIGESTMD5_RESP;
break;
case SASL_DIGESTMD5_RESP:
if(!(resp = strdup("")))
resp = strdup("");
if(!resp)
result = CURLE_OUT_OF_MEMORY;
break;
#endif

View File

@ -155,8 +155,9 @@ static CURLcode ftp_dophase_done(struct connectdata *conn,
bool connected);
/* easy-to-use macro: */
#define PPSENDF(x,y,z) if((result = Curl_pp_sendf(x,y,z))) \
return result
#define PPSENDF(x,y,z) result = Curl_pp_sendf(x,y,z); \
if(result) \
return result
/*

View File

@ -910,8 +910,8 @@ static CURLcode imap_state_capability_resp(struct connectdata *conn,
wordlen -= 5;
/* Test the word for a matching authentication mechanism */
if((mechbit = Curl_sasl_decode_mech(line, wordlen, &llen)) &&
llen == wordlen)
mechbit = Curl_sasl_decode_mech(line, wordlen, &llen);
if(mechbit && llen == wordlen)
imapc->sasl.authmechs |= mechbit;
}

View File

@ -753,8 +753,8 @@ static CURLcode pop3_state_capa_resp(struct connectdata *conn, int pop3code,
wordlen++;
/* Test the word for a matching authentication mechanism */
if((mechbit = Curl_sasl_decode_mech(line, wordlen, &llen)) &&
llen == wordlen)
mechbit = Curl_sasl_decode_mech(line, wordlen, &llen);
if(mechbit && llen == wordlen)
pop3c->sasl.authmechs |= mechbit;
line += wordlen;

View File

@ -770,8 +770,8 @@ static CURLcode smtp_state_ehlo_resp(struct connectdata *conn, int smtpcode,
wordlen++;
/* Test the word for a matching authentication mechanism */
if((mechbit = Curl_sasl_decode_mech(line, wordlen, &llen)) &&
llen == wordlen)
mechbit = Curl_sasl_decode_mech(line, wordlen, &llen);
if(mechbit && llen == wordlen)
smtpc->sasl.authmechs |= mechbit;
line += wordlen;