From 35df7a7eb4adbf262444ffc36a8f6253dddd7b2c Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Sun, 2 Jun 2013 22:18:19 -0400 Subject: [PATCH] ostree-prepare-root: Don't require an extraneous argument --- src/switchroot/ostree-prepare-root.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/switchroot/ostree-prepare-root.c b/src/switchroot/ostree-prepare-root.c index 65bb7305..470ed3c7 100644 --- a/src/switchroot/ostree-prepare-root.c +++ b/src/switchroot/ostree-prepare-root.c @@ -82,7 +82,7 @@ parse_ostree_cmdline (char **out_osname, { const char *next = strchr (iter, ' '); const char *next_nonspc = next; - while (*next_nonspc == ' ') + while (next_nonspc && *next_nonspc == ' ') next_nonspc += 1; if (strncmp (iter, "ostree=", strlen ("ostree=")) == 0) { @@ -121,9 +121,9 @@ main(int argc, char *argv[]) size_t len; int i; - if (argc < 3) + if (argc < 2) { - fprintf (stderr, "usage: ostree-prepare-root SYSROOT OSTREE\n"); + fprintf (stderr, "usage: ostree-prepare-root SYSROOT\n"); exit (1); }