pkarashchenko commented on a change in pull request #5004:
URL: https://github.com/apache/incubator-nuttx/pull/5004#discussion_r769449261
##########
File path: libs/libc/unistd/lib_getopt_common.c
##########
@@ -393,6 +393,14 @@ int getopt_common(int argc, FAR char * const argv[],
/* Check for the end of the argument list */
+ if (go->go_optind >= argc)
+ {
+ /* We don't need to check arguments anymore, we are finished */
+
+ go->go_binitialized = false;
+ return ERROR;
+ }
+
go->go_optptr = argv[go->go_optind];
Review comment:
I'm not sure how to answer your question. In general ternary operator is
widely used in NuttX code. Also I think that code duplication should be avoided
and if we can achieve this with ternary operator then it should be used.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]