ui/devcmd: make sure the 'total size' argument for the 'erase' command makes sense
This commit is contained in:
parent
f1d416944c
commit
39a44095eb
|
@ -207,6 +207,12 @@ int cmd_erase(char **arg)
|
||||||
"0x%x\n", segment_size);
|
"0x%x\n", segment_size);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (total_size % segment_size != 0) {
|
||||||
|
printc_err("erase: total size must be a multiple of the "
|
||||||
|
"segment size!\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
printc_err("erase: unknown erase type: %s\n",
|
printc_err("erase: unknown erase type: %s\n",
|
||||||
type_text);
|
type_text);
|
||||||
|
|
Loading…
Reference in New Issue