aboutsummaryrefslogtreecommitdiff
path: root/lib/ftp.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ftp.c')
-rw-r--r--lib/ftp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index bfa34bae8..bc069a2b0 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -138,8 +138,10 @@ static int ftp_need_type(struct connectdata *conn,
bool ascii);
/* easy-to-use macro: */
-#define FTPSENDF(x,y,z) if((result = Curl_ftpsendf(x,y,z))) return result
-#define NBFTPSENDF(x,y,z) if((result = Curl_nbftpsendf(x,y,z))) return result
+#define FTPSENDF(x,y,z) if ((result = Curl_ftpsendf(x,y,z)) != CURLE_OK) \
+ return result
+#define NBFTPSENDF(x,y,z) if ((result = Curl_nbftpsendf(x,y,z)) != CURLE_OK) \
+ return result
static void freedirs(struct FTP *ftp)
{
@@ -3878,7 +3880,7 @@ CURLcode ftp_parse_url_path(struct connectdata *conn)
return CURLE_OUT_OF_MEMORY;
/* parse the URL path into separate path components */
- while((slash_pos=strchr(cur_pos, '/'))) {
+ while ((slash_pos = strchr(cur_pos, '/')) != NULL) {
/* 1 or 0 to indicate absolute directory */
bool absolute_dir = (cur_pos - conn->path > 0) && (ftp->dirdepth == 0);