From a605a2ae4ded6a18bda614c2d74bba32a2724b81 Mon Sep 17 00:00:00 2001 From: pooler Date: Sat, 11 Feb 2012 02:32:49 +0100 Subject: [PATCH] Throw an error if non-option arguments are supplied --- cpu-miner.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cpu-miner.c b/cpu-miner.c index 3bb2dce..55b5a8a 100644 --- a/cpu-miner.c +++ b/cpu-miner.c @@ -838,6 +838,11 @@ static void parse_cmdline(int argc, char *argv[]) parse_arg(key, optarg); } + if (optind < argc) { + fprintf(stderr, "%s: unsupported non-option argument '%s'\n", + argv[0], argv[optind]); + show_usage_and_exit(1); + } parse_config(); }