From 22494a8d105936785af53235b088fa38112128fc Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Tue, 30 Jun 2009 13:03:45 +0300 Subject: ubiformat: allow zero erase counter This patch fixes the following issue: $ ubiformat /dev/mtd2 -e 0 ubiformat: error!: bad erase counter value: "0" Signed-off-by: Artem Bityutskiy --- ubi-utils/src/ubiformat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ubi-utils/src/ubiformat.c b/ubi-utils/src/ubiformat.c index a3df281..2a62f3b 100644 --- a/ubi-utils/src/ubiformat.c +++ b/ubi-utils/src/ubiformat.c @@ -154,7 +154,7 @@ static int parse_opt(int argc, char * const argv[]) case 'e': args.ec = strtoull(optarg, &endp, 0); - if (args.ec <= 0 || *endp != '\0' || endp == optarg) + if (args.ec < 0 || *endp != '\0' || endp == optarg) return errmsg("bad erase counter value: \"%s\"", optarg); if (args.ec >= EC_MAX) return errmsg("too high erase %llu, counter, max is %u", args.ec, EC_MAX); -- cgit v1.2.3