]> granicus.if.org Git - curl/commitdiff
ftp: Expression 'ftpc->wait_data_conn' is always true
authorDaniel Stenberg <daniel@haxx.se>
Thu, 19 Sep 2019 07:16:41 +0000 (09:16 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 20 Sep 2019 06:07:00 +0000 (08:07 +0200)
Fixes warning detected by PVS-Studio
Fixes #4374

lib/ftp.c

index 59ca13ef1f773183655f6c9785e21f37914c7251..a4a37c9affa5a5e583cf79885c8b216d2c05fa0d 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -3530,14 +3530,13 @@ static CURLcode ftp_do_more(struct connectdata *conn, int *completep)
 
     /* if we got an error or if we don't wait for a data connection return
        immediately */
-    if(result || (ftpc->wait_data_conn != TRUE))
+    if(result || !ftpc->wait_data_conn)
       return result;
 
-    if(ftpc->wait_data_conn)
-      /* if we reach the end of the FTP state machine here, *complete will be
-         TRUE but so is ftpc->wait_data_conn, which says we need to wait for
-         the data connection and therefore we're not actually complete */
-      *completep = 0;
+    /* if we reach the end of the FTP state machine here, *complete will be
+       TRUE but so is ftpc->wait_data_conn, which says we need to wait for the
+       data connection and therefore we're not actually complete */
+    *completep = 0;
   }
 
   if(ftp->transfer <= FTPTRANSFER_INFO) {