diff options
author | Steve Holme <steve_holme@hotmail.com> | 2016-03-19 17:15:53 +0000 |
---|---|---|
committer | Steve Holme <steve_holme@hotmail.com> | 2016-03-19 17:15:53 +0000 |
commit | c142e73142e377f9bcd75fed0a558ce30323e98c (patch) | |
tree | 3c26f8a4139d9cd87491b3b4b1810faf3e6a2e4b | |
parent | 4ff2fbd1d5d743556627816f4727c499c480d633 (diff) |
ftp/imap/pop3/smtp: Fixed compilation warning when /Wall enabled
warning C4706: assignment within conditional expression
-rw-r--r-- | lib/curl_sasl.c | 15 | ||||
-rw-r--r-- | lib/ftp.c | 5 | ||||
-rw-r--r-- | lib/imap.c | 4 | ||||
-rw-r--r-- | lib/pop3.c | 4 | ||||
-rw-r--r-- | lib/smtp.c | 4 |
5 files changed, 18 insertions, 14 deletions
diff --git a/lib/curl_sasl.c b/lib/curl_sasl.c index aac2bcd29..945d75232 100644 --- a/lib/curl_sasl.c +++ b/lib/curl_sasl.c @@ -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 @@ -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 /* diff --git a/lib/imap.c b/lib/imap.c index a3d2cad22..ff25e54e0 100644 --- a/lib/imap.c +++ b/lib/imap.c @@ -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; } diff --git a/lib/pop3.c b/lib/pop3.c index cb53b7445..823761d2e 100644 --- a/lib/pop3.c +++ b/lib/pop3.c @@ -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; diff --git a/lib/smtp.c b/lib/smtp.c index 2a87c6eae..83e51bf80 100644 --- a/lib/smtp.c +++ b/lib/smtp.c @@ -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; |