analyze: fix seg-fault with no cl-argument
authorDaniel Buch <boogiewasthere@gmail.com>
Thu, 24 Jul 2014 21:29:40 +0000 (23:29 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 26 Jul 2014 19:08:42 +0000 (15:08 -0400)
We need to check if argv[1] is set before compare

src/analyze/analyze.c

index 66e2aab..453ad33 100644 (file)
@@ -1349,7 +1349,7 @@ int main(int argc, char *argv[]) {
         if (r <= 0)
                 goto finish;
 
-        if (streq(argv[optind], "verify"))
+        if (streq_ptr(argv[optind], "verify"))
                 r = verify_units(argv+optind+1,
                                  arg_user ? SYSTEMD_USER : SYSTEMD_SYSTEM,
                                  arg_man);