Fix returning EOF when reading an element outside the size.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2023-04-06 14:08:43 +02:00
parent 405bf92e18
commit f22f58f983

View File

@@ -85,7 +85,7 @@ int cmd_read_binary() {
else {
uint16_t data_len = file_get_size(ef);
if (offset > data_len) {
return SW_WRONG_P1P2();
return SW_WARNING_EOF();
}
uint16_t maxle = data_len - offset;