NSH uname command: Uninitialized variable caused failures in some unlucky cases

This commit is contained in:
Gregory Nutt 2015-07-05 09:06:13 -06:00
parent 584284adc3
commit 74aa0f21c5

View File

@ -239,7 +239,9 @@ int cmd_uname(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
/* Get the ping options */
set = 0;
set = 0;
badarg = false;
while ((option = getopt(argc, argv, "asonrvmpi")) != ERROR)
{
switch (option)
@ -334,7 +336,6 @@ int cmd_uname(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
case 1: /* Print noname */
str = info.nodename;
break;
#endif
case 2: /* Print the kernel release */
str = info.release;