mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 17:38:00 +00:00
resolve couple of issues found by cppcheck:
[psftp.c:1135] -> [psftp.c:1134]: (warning) Either the condition '!dir' is redundant or there is possible null pointer dereference: dir. [psftp.c:1420] -> [psftp.c:1419]: (warning) Either the condition '!dir' is redundant or there is possible null pointer dereference: dir.
This commit is contained in:
parent
4387b5f161
commit
5efee18356
12
psftp.c
12
psftp.c
@ -1128,12 +1128,12 @@ int sftp_cmd_cd(struct sftp_command *cmd)
|
||||
|
||||
if (cmd->nwords < 2)
|
||||
dir = dupstr(homedir);
|
||||
else
|
||||
else {
|
||||
dir = canonify(cmd->words[1]);
|
||||
|
||||
if (!dir) {
|
||||
printf("%s: canonify: %s\n", dir, fxp_error());
|
||||
return 0;
|
||||
if (!dir) {
|
||||
printf("%s: canonify: %s\n", cmd->words[1], fxp_error());
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
req = fxp_opendir_send(dir);
|
||||
@ -1417,7 +1417,7 @@ int sftp_cmd_mkdir(struct sftp_command *cmd)
|
||||
for (i = 1; i < cmd->nwords; i++) {
|
||||
dir = canonify(cmd->words[i]);
|
||||
if (!dir) {
|
||||
printf("%s: canonify: %s\n", dir, fxp_error());
|
||||
printf("%s: canonify: %s\n", cmd->words[i], fxp_error());
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user