summaryrefslogtreecommitdiff
path: root/lib/pop3.c
diff options
context:
space:
mode:
authorMarcel Raad <Marcel.Raad@teamviewer.com>2019-05-25 10:06:08 +0200
committerMarcel Raad <Marcel.Raad@teamviewer.com>2019-06-05 20:38:06 +0200
commite23c52b3295a525fbaae9e7ed3e7061fea6dffc2 (patch)
tree4a74cf5ed3496a6126f1cc7c4284b6620108db06 /lib/pop3.c
parent04ac54e1965041684fc1b6532eba90f58601264e (diff)
downloadcurl-e23c52b3295a525fbaae9e7ed3e7061fea6dffc2.tar.gz
build: fix Codacy warnings
Reduce variable scopes and remove redundant variable stores. Closes https://github.com/curl/curl/pull/3975
Diffstat (limited to 'lib/pop3.c')
-rw-r--r--lib/pop3.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/lib/pop3.c b/lib/pop3.c
index c8f3965e4..a681d5213 100644
--- a/lib/pop3.c
+++ b/lib/pop3.c
@@ -339,10 +339,8 @@ static CURLcode pop3_perform_capa(struct connectdata *conn)
*/
static CURLcode pop3_perform_starttls(struct connectdata *conn)
{
- CURLcode result = CURLE_OK;
-
/* Send the STLS command */
- result = Curl_pp_sendf(&conn->proto.pop3c.pp, "%s", "STLS");
+ CURLcode result = Curl_pp_sendf(&conn->proto.pop3c.pp, "%s", "STLS");
if(!result)
state(conn, POP3_STARTTLS);
@@ -358,11 +356,10 @@ static CURLcode pop3_perform_starttls(struct connectdata *conn)
*/
static CURLcode pop3_perform_upgrade_tls(struct connectdata *conn)
{
- CURLcode result = CURLE_OK;
- struct pop3_conn *pop3c = &conn->proto.pop3c;
-
/* Start the SSL connection */
- result = Curl_ssl_connect_nonblocking(conn, FIRSTSOCKET, &pop3c->ssldone);
+ struct pop3_conn *pop3c = &conn->proto.pop3c;
+ CURLcode result = Curl_ssl_connect_nonblocking(conn, FIRSTSOCKET,
+ &pop3c->ssldone);
if(!result) {
if(pop3c->state != POP3_UPGRADETLS)
@@ -593,10 +590,8 @@ static CURLcode pop3_perform_command(struct connectdata *conn)
*/
static CURLcode pop3_perform_quit(struct connectdata *conn)
{
- CURLcode result = CURLE_OK;
-
/* Send the QUIT command */
- result = Curl_pp_sendf(&conn->proto.pop3c.pp, "%s", "QUIT");
+ CURLcode result = Curl_pp_sendf(&conn->proto.pop3c.pp, "%s", "QUIT");
if(!result)
state(conn, POP3_QUIT);