aboutsummaryrefslogtreecommitdiff
path: root/ubi-utils
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2009-06-30 13:03:45 +0300
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2009-06-30 14:55:56 +0300
commit22494a8d105936785af53235b088fa38112128fc (patch)
tree22fc34f056877183467c063dede78e6c9d4fb3b6 /ubi-utils
parentbc0cd0d9606c7d0c41d09a694b49bade159815b1 (diff)
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 <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'ubi-utils')
-rw-r--r--ubi-utils/src/ubiformat.c2
1 files changed, 1 insertions, 1 deletions
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);