Commit 38797dc3 authored by Michael Niedermayer's avatar Michael Niedermayer

compat/getopt: add {} to complex ifs

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent fbedce6b
......@@ -46,7 +46,7 @@ static int getopt(int argc, char *argv[], char *opts)
int c;
char *cp;
if (sp == 1)
if (sp == 1) {
if (optind >= argc ||
argv[optind][0] != '-' || argv[optind][1] == '\0')
return EOF;
......@@ -54,6 +54,7 @@ static int getopt(int argc, char *argv[], char *opts)
optind++;
return EOF;
}
}
optopt = c = argv[optind][sp];
if (c == ':' || (cp = strchr(opts, c)) == NULL) {
fprintf(stderr, ": illegal option -- %c\n", c);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment