summaryrefslogtreecommitdiff
path: root/ubi-utils/src
diff options
context:
space:
mode:
Diffstat (limited to 'ubi-utils/src')
-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);