mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-19 19:44:35 +08:00
NSH uname command: Uninitialized variable caused failures in some unlucky cases
This commit is contained in:
@@ -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;
|
||||||
|
Reference in New Issue
Block a user