takumiando commented on a change in pull request #5004:
URL: https://github.com/apache/incubator-nuttx/pull/5004#discussion_r769419884



##########
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:
       Is ternary operator recommended if it can be shorter or simple in NuttX 
project ?
   I sent PR to here for the first time.




-- 
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]


Reply via email to