aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2016-03-10 13:52:22 +0100
committerDaniel Stenberg <daniel@haxx.se>2016-03-10 13:52:22 +0100
commit863c5766dd7e99210da637e7e799a179b0ec5c07 (patch)
treeedb2fc7479cf0863af251a192a7ec3f0b4970a98
parent7f7fcd0d756416b0a146b6f34a899e59456b2c17 (diff)
ftp: remove a check for NULL(!)
... as it implies we need to check for that on all the other variable references as well (as Coverity otherwise warns us for missing NULL checks), and we're alredy making sure that the pointer is never NULL.
-rw-r--r--lib/ftp.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index 1008c635f..40c51ead5 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -4273,16 +4273,17 @@ CURLcode ftp_parse_url_path(struct connectdata *conn)
the first condition in the if() right here, is there just in case
someone decides to set path to NULL one day
*/
- if(data->state.path &&
- data->state.path[0] &&
- (data->state.path[strlen(data->state.path) - 1] != '/') )
- filename = data->state.path; /* this is a full file path */
- /*
+ if(path_to_use[0] &&
+ (path_to_use[strlen(path_to_use) - 1] != '/') )
+ filename = path_to_use; /* this is a full file path */
+ /*
+ else {
ftpc->file is not used anywhere other than for operations on a file.
In other words, never for directory operations.
So we can safely leave filename as NULL here and use it as a
argument in dir/file decisions.
- */
+ }
+ */
break;
case FTPFILE_SINGLECWD: