]> www.infradead.org Git - mtd-utils.git/commitdiff
ubi-utils: fixe ubiupdatevol
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Tue, 13 May 2008 11:28:45 +0000 (14:28 +0300)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Tue, 13 May 2008 11:30:13 +0000 (14:30 +0300)
-t option does not require image file.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
ubi-utils/new-utils/src/ubiupdatevol.c

index 7748de84ab804b67be2b2a7ec34a837fdcd4142a..ae7b9ff80fef5fb4516d0ea66085bec3a8cab7e2 100644 (file)
@@ -143,7 +143,7 @@ static int parse_opt(int argc, char * const argv[])
        } else {
                if (optind == argc)
                        return errmsg("UBI device name was not specified (use -h for help)");
-               else if (optind != argc - 2)
+               else if (optind != argc - 2 && !args.truncate)
                        return errmsg("specify UBI device name and image file name as first 2 "
                                      "parameters (use -h for help)");
        }
@@ -292,9 +292,6 @@ int main(int argc, char * const argv[])
        if (err)
                return -1;
 
-       if (!args.img && !args.truncate)
-               return errmsg("incorrect arguments, use -h for help");
-
        libubi = libubi_open(1);
        if (libubi == NULL) {
                sys_errmsg("cannot open libubi");