From fd595692941f3d9ddea8934462bd1d18aed07c65 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Tue, 7 Jul 2015 11:31:20 +0300 Subject: [PATCH] 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 Signed-off-by: Pekka Paalanen --- test/lowlevel-blt-bench.c | 6 ++++++ 1 file changed, 6 insertions(+) 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]; } } -- 2.7.4