You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/12/15 09:04:04 UTC
[GitHub] [incubator-nuttx] takumiando commented on a change in pull request #5004: libc/unistd: getopt: Use argc to end parsing
takumiando commented on a change in pull request #5004:
URL: https://github.com/apache/incubator-nuttx/pull/5004#discussion_r769407183
##########
File path: libs/libc/unistd/lib_getopt_common.c
##########
@@ -394,7 +394,7 @@ int getopt_common(int argc, FAR char * const argv[],
/* Check for the end of the argument list */
go->go_optptr = argv[go->go_optind];
- if (!go->go_optptr)
+ if (!go->go_optptr || go->go_optind >= argc)
Review comment:
@pkarashchenko
Thanks for your review!
You're right, I force-pushed it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org