]> The Tcpdump Group git mirrors - tcpdump/blobdiff - missing/getopt_long.c
CI: Add warning exemptions for Sun C (suncc-5.14) on Solaris 10
[tcpdump] / missing / getopt_long.c
index 5018400ed0e41d5c09b42323f8958b08ba56d0de..e9b1ef5770a132fb546c09ddde2bf29c3c5b1f96 100644 (file)
@@ -70,7 +70,7 @@
 /* return values */
 #define        BADCH           (int)'?'
 #define        BADARG          ((*options == ':') ? (int)':' : (int)'?')
-#define        INORDER         (int)1
+#define        INORDER         (int)1
 
 #define        EMSG            ""
 
@@ -419,8 +419,7 @@ start:
                                permute_args(nonopt_start, nonopt_end,
                                    optind, nargv);
                                optind -= nonopt_end - nonopt_start;
-                       }
-                       else if (nonopt_start != -1) {
+                       } else if (nonopt_start != -1) {
                                /*
                                 * If we skipped non-options, set optind
                                 * to the first of them.
@@ -565,11 +564,11 @@ start:
                        ++optind;
        } else {                                /* takes (optional) argument */
                optarg = NULL;
+               if (*place) {                   /* no white space */
 DIAG_OFF_CAST_QUAL
-               if (*place)                     /* no white space */
                        optarg = (char *)place;
 DIAG_ON_CAST_QUAL
-               else if (oli[1] != ':') {       /* arg not optional */
+               } else if (oli[1] != ':') {     /* arg not optional */
                        if (++optind >= nargc) {        /* no arg */
                                place = EMSG;
                                if (PRINT_ERROR)