summaryrefslogtreecommitdiffstats
path: root/newlib/libc/stdlib/getopt.c
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/stdlib/getopt.c')
-rw-r--r--newlib/libc/stdlib/getopt.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/newlib/libc/stdlib/getopt.c b/newlib/libc/stdlib/getopt.c
index 06e378170..09952db19 100644
--- a/newlib/libc/stdlib/getopt.c
+++ b/newlib/libc/stdlib/getopt.c
@@ -308,13 +308,8 @@ getopt_internal (int argc, char *const argv[], const char *shortopts,
case OPTIONAL_ARG:
if (*possible_arg == '=')
possible_arg++;
- if (*possible_arg != '\0')
- {
- optarg = possible_arg;
- optwhere = 1;
- }
- else
- optarg = NULL;
+ optarg = (*possible_arg != '\0') ? possible_arg : NULL;
+ optwhere = 1;
break;
case REQUIRED_ARG:
if (*possible_arg == '=')