Skip to content

Commit 39bd365

Browse files
JianyuWang0623xiaoxiang781216
authored andcommitted
nshlib/nsh_parse: Removing unnecessary value assigning about redirection
Coverity Log CID 1612757: (#1 of 1): UNUSED_VALUE assigned_value: The value -1 is assigned to param.fd_in here, but the stored value is overwritten before it can be used. Signed-off-by: wangjianyu3 <[email protected]>
1 parent f1212a6 commit 39bd365

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

nshlib/nsh_parse.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2739,16 +2739,12 @@ static int nsh_parse_command(FAR struct nsh_vtbl_s *vtbl, FAR char *cmdline)
27392739
if (param.fd_in != -1)
27402740
{
27412741
close(param.fd_in);
2742-
param.fd_in = -1;
27432742
vtbl->np.np_redir_in = redirect_in_save;
27442743
}
27452744

2746-
if (param.fd_out != -1)
2747-
{
2748-
close(param.fd_out);
2749-
param.fd_out = -1;
2750-
vtbl->np.np_redir_out = redirect_out_save;
2751-
}
2745+
close(param.fd_out);
2746+
param.fd_out = -1;
2747+
vtbl->np.np_redir_out = redirect_out_save;
27522748

27532749
redirect_in_save = vtbl->np.np_redir_in;
27542750
vtbl->np.np_redir_in = true;

0 commit comments

Comments
 (0)