summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2012-07-18 16:46:11 +0200
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2012-07-18 16:46:11 +0200
commitc0a871d98d351623f82c927b8850c2b04acf36d2 (patch)
tree7d78831f687e020e435fbfa147f171b0b0f6ef02
parentdec2d75dc6b6f1db30042a5b39a12263ababfb87 (diff)
downloadufodecode-c0a871d98d351623f82c927b8850c2b04acf36d2.tar.gz
ufodecode-c0a871d98d351623f82c927b8850c2b04acf36d2.tar.bz2
ufodecode-c0a871d98d351623f82c927b8850c2b04acf36d2.tar.xz
ufodecode-c0a871d98d351623f82c927b8850c2b04acf36d2.zip
Issue `no input files` also with options set
-rw-r--r--test/ipedec.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/ipedec.c b/test/ipedec.c
index 8059276..56236ce 100644
--- a/test/ipedec.c
+++ b/test/ipedec.c
@@ -208,11 +208,6 @@ int main(int argc, char const* argv[])
int verbose = 0;
int rows = 1088;
- if (argc == 1) {
- printf("ipedec: no input files\n");
- return 0;
- }
-
while ((getopt_ret = getopt_long(argc, (char *const *) argv, "r:cvh", long_options, &index)) != -1) {
switch (getopt_ret) {
case 'r':
@@ -232,6 +227,11 @@ int main(int argc, char const* argv[])
}
}
+ if (optind == argc) {
+ printf("ipedec: no input files\n");
+ return 1;
+ }
+
while (optind < argc)
process_file(argv[optind++], rows, clear_frame, verbose);