aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2016-03-19 17:15:53 +0000
committerSteve Holme <steve_holme@hotmail.com>2016-03-19 17:15:53 +0000
commitc142e73142e377f9bcd75fed0a558ce30323e98c (patch)
tree3c26f8a4139d9cd87491b3b4b1810faf3e6a2e4b /lib
parent4ff2fbd1d5d743556627816f4727c499c480d633 (diff)
ftp/imap/pop3/smtp: Fixed compilation warning when /Wall enabled
warning C4706: assignment within conditional expression
Diffstat (limited to 'lib')
-rw-r--r--lib/curl_sasl.c15
-rw-r--r--lib/ftp.c5
-rw-r--r--lib/imap.c4
-rw-r--r--lib/pop3.c4
-rw-r--r--lib/smtp.c4
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
diff --git a/lib/ftp.c b/lib/ftp.c
index 40c51ead5..9b728cc98 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -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;