]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- fix abrt if no argument is passed to diff command 3/head
authorOndrej Kozina <okozina@redhat.com>
Thu, 25 Oct 2012 13:36:56 +0000 (15:36 +0200)
committerOndrej Kozina <okozina@redhat.com>
Thu, 25 Oct 2012 14:57:04 +0000 (16:57 +0200)
client/snapper.cc

index 7259f85d131c5eeada082158d2e59fdedb42891c..efd5005666cbff4f686404f6dc5f0e306890018c 100644 (file)
@@ -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<unsigned int, unsigned int> nums(read_nums(getopts.popArg()));