From: Ondrej Kozina Date: Thu, 25 Oct 2012 13:36:56 +0000 (+0200) Subject: - fix abrt if no argument is passed to diff command X-Git-Tag: v0.1.3~72^2 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=e19d09dc087cf588c049d257bfcf2cb0255d540a;p=thirdparty%2Fsnapper.git - fix abrt if no argument is passed to diff command --- 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()));