diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2017-08-17 14:52:10 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2017-08-17 14:52:10 +0200 |
| commit | 9f7d79fd30df3712e6bfc6d475bfa143c069c4df (patch) | |
| tree | c73bd4cd00b7665f64d3a2616e8e98141fbdf122 /src | |
| parent | 1ab6e0e07a67193564811c5720a69cb28f09a809 (diff) | |
opj_getopt_long(): avoid infinite loop on invalid or missing value for an option (#736)
Diffstat (limited to 'src')
| -rw-r--r-- | src/bin/common/opj_getopt.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/bin/common/opj_getopt.c b/src/bin/common/opj_getopt.c index ef9a920a..5db94ca0 100644 --- a/src/bin/common/opj_getopt.c +++ b/src/bin/common/opj_getopt.c @@ -240,6 +240,7 @@ again: '-') { /* Has read next input parameter: No arg for current parameter */ if (opj_opterr) { fprintf(stderr, "%s: option requires an argument\n", arg); + ++opj_optind; return (BADCH); } } @@ -247,6 +248,7 @@ again: if (!opj_optarg) { /* missing argument */ if (opj_opterr) { fprintf(stderr, "%s: option requires an argument\n", arg); + ++opj_optind; return (BADCH); } } |
