From e19d09dc087cf588c049d257bfcf2cb0255d540a Mon Sep 17 00:00:00 2001 From: Ondrej Kozina Date: Thu, 25 Oct 2012 15:36:56 +0200 Subject: [PATCH] - fix abrt if no argument is passed to diff command --- client/snapper.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/snapper.cc b/client/snapper.cc index 7259f85d..efd50056 100644 --- a/client/snapper.cc +++ b/client/snapper.cc @@ -831,6 +831,11 @@ command_diff(DBus::Connection& conn) { GetOpts::parsed_opts opts = getopts.parse("diff", GetOpts::no_options); + if (getopts.numArgs() < 1) { + cerr << _("Command 'diff' needs at least one argument.") << endl; + exit(EXIT_FAILURE); + } + GetOpts::parsed_opts::const_iterator opt; pair nums(read_nums(getopts.popArg())); -- 2.47.3