NSH uname command: Uninitialized variable caused failures in some unlucky cases
This commit is contained in:
parent
584284adc3
commit
74aa0f21c5
@ -239,7 +239,9 @@ int cmd_uname(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
|||||||
|
|
||||||
/* Get the ping options */
|
/* Get the ping options */
|
||||||
|
|
||||||
set = 0;
|
set = 0;
|
||||||
|
badarg = false;
|
||||||
|
|
||||||
while ((option = getopt(argc, argv, "asonrvmpi")) != ERROR)
|
while ((option = getopt(argc, argv, "asonrvmpi")) != ERROR)
|
||||||
{
|
{
|
||||||
switch (option)
|
switch (option)
|
||||||
@ -334,7 +336,6 @@ int cmd_uname(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
|||||||
case 1: /* Print noname */
|
case 1: /* Print noname */
|
||||||
str = info.nodename;
|
str = info.nodename;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
case 2: /* Print the kernel release */
|
case 2: /* Print the kernel release */
|
||||||
str = info.release;
|
str = info.release;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user