Uninitialized variable can cause hardfault from getopt if required argument is missing.
This commit is contained in:
parent
d8da1d61ec
commit
c8b221e03f
@ -258,6 +258,7 @@ int getopt(int argc, FAR char *const argv[], FAR const char *optstring)
|
|||||||
|
|
||||||
/* No argument was supplied */
|
/* No argument was supplied */
|
||||||
|
|
||||||
|
g_optptr = NULL;
|
||||||
optarg = NULL;
|
optarg = NULL;
|
||||||
optopt = *optchar;
|
optopt = *optchar;
|
||||||
optind++;
|
optind++;
|
||||||
|
Loading…
Reference in New Issue
Block a user