diff options
author | Pekka Paalanen <pekka.paalanen@collabora.co.uk> | 2015-07-07 11:31:20 +0300 |
---|---|---|
committer | Pekka Paalanen <pekka.paalanen@collabora.co.uk> | 2015-08-18 10:23:27 +0300 |
commit | fd595692941f3d9ddea8934462bd1d18aed07c65 (patch) | |
tree | 3b2579c6eacc677bb2e6af6554b8a03f93ca92b1 /test/lowlevel-blt-bench.c | |
parent | 69611473c5a4e7cc2e6016d82ff4ed28e289484a (diff) |
lowlevel-blt-bench: make extra arguments an error
If a user gives multiple patterns or extra arguments, only the last one
was used as the pattern while the former were just ignored. This is a
user error silently converted to something possibly unexpected.
In presence of extra arguments, complain and quit.
Cc: Ben Avison <bavison@riscosopen.org>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Diffstat (limited to 'test/lowlevel-blt-bench.c')
-rw-r--r-- | test/lowlevel-blt-bench.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/lowlevel-blt-bench.c b/test/lowlevel-blt-bench.c index fc7472f..28ff669 100644 --- a/test/lowlevel-blt-bench.c +++ b/test/lowlevel-blt-bench.c @@ -1122,6 +1122,12 @@ main (int argc, char *argv[]) } else { + if (pattern) + { + pattern = NULL; + printf ("Error: extra arguments given.\n"); + break; + } pattern = argv[i]; } } |