From 3bd883f344a5d6f155f7252e8a478d5b7935d7c6 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 19 Nov 2010 13:05:49 +0000 Subject: [PATCH] cat: Give a better error if the user specified no drives on command line. --- cat/virt-cat.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cat/virt-cat.c b/cat/virt-cat.c index 58ebd8e..3510a94 100644 --- a/cat/virt-cat.c +++ b/cat/virt-cat.c @@ -220,6 +220,10 @@ main (int argc, char *argv[]) if (optind >= argc || argc - optind < 1) usage (EXIT_FAILURE); + /* User must have specified some drives. */ + if (drvs == NULL) + usage (EXIT_FAILURE); + /* Add drives, inspect and mount. Note that inspector is always true, * and there is no -m option. */ -- 1.8.3.1