1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-08 13:22:53 +02:00

compat/getopt: add {} to complex ifs

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-10-21 17:34:14 +02:00
parent fbedce6b85
commit 38797dc31b

View File

@ -46,7 +46,7 @@ static int getopt(int argc, char *argv[], char *opts)
int c; int c;
char *cp; char *cp;
if (sp == 1) if (sp == 1) {
if (optind >= argc || if (optind >= argc ||
argv[optind][0] != '-' || argv[optind][1] == '\0') argv[optind][0] != '-' || argv[optind][1] == '\0')
return EOF; return EOF;
@ -54,6 +54,7 @@ static int getopt(int argc, char *argv[], char *opts)
optind++; optind++;
return EOF; return EOF;
} }
}
optopt = c = argv[optind][sp]; optopt = c = argv[optind][sp];
if (c == ':' || (cp = strchr(opts, c)) == NULL) { if (c == ':' || (cp = strchr(opts, c)) == NULL) {
fprintf(stderr, ": illegal option -- %c\n", c); fprintf(stderr, ": illegal option -- %c\n", c);