diff --git a/lib/ssh.c b/lib/ssh.c index f468e4c84..6a71a875d 100644 --- a/lib/ssh.c +++ b/lib/ssh.c @@ -1793,7 +1793,8 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block) break; case SSH_SFTP_CREATE_DIRS: - if((sshc->slash_pos = strchr(sshc->slash_pos, '/')) != NULL) { + sshc->slash_pos = strchr(sshc->slash_pos, '/'); + if(sshc->slash_pos) { *sshc->slash_pos = 0; infof(data, "Creating directory '%s'\n", sftp_scp->path);