mirror of
https://github.com/pellepl/spiffs.git
synced 2026-09-13 20:50:01 +00:00
Don't exit the test if the write is out of range. Just fail it.
This commit is contained in:
@@ -175,12 +175,12 @@ static s32_t _read(
|
|||||||
if (addr < SPIFFS_CFG_PHYS_ADDR(&__fs)) {
|
if (addr < SPIFFS_CFG_PHYS_ADDR(&__fs)) {
|
||||||
printf("FATAL read addr too low %08x < %08x\n", addr, SPIFFS_PHYS_ADDR);
|
printf("FATAL read addr too low %08x < %08x\n", addr, SPIFFS_PHYS_ADDR);
|
||||||
ERREXIT();
|
ERREXIT();
|
||||||
exit(0);
|
return -1;
|
||||||
}
|
}
|
||||||
if (addr + size > SPIFFS_CFG_PHYS_ADDR(&__fs) + SPIFFS_CFG_PHYS_SZ(&__fs)) {
|
if (addr + size > SPIFFS_CFG_PHYS_ADDR(&__fs) + SPIFFS_CFG_PHYS_SZ(&__fs)) {
|
||||||
printf("FATAL read addr too high %08x + %08x > %08x\n", addr, size, SPIFFS_PHYS_ADDR + SPIFFS_FLASH_SIZE);
|
printf("FATAL read addr too high %08x + %08x > %08x\n", addr, size, SPIFFS_PHYS_ADDR + SPIFFS_FLASH_SIZE);
|
||||||
ERREXIT();
|
ERREXIT();
|
||||||
exit(0);
|
return -1;
|
||||||
}
|
}
|
||||||
memcpy(dst, &AREA(addr), size);
|
memcpy(dst, &AREA(addr), size);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -207,12 +207,12 @@ static s32_t _write(
|
|||||||
if (addr < SPIFFS_CFG_PHYS_ADDR(&__fs)) {
|
if (addr < SPIFFS_CFG_PHYS_ADDR(&__fs)) {
|
||||||
printf("FATAL write addr too low %08x < %08x\n", addr, SPIFFS_PHYS_ADDR);
|
printf("FATAL write addr too low %08x < %08x\n", addr, SPIFFS_PHYS_ADDR);
|
||||||
ERREXIT();
|
ERREXIT();
|
||||||
exit(0);
|
return -1;
|
||||||
}
|
}
|
||||||
if (addr + size > SPIFFS_CFG_PHYS_ADDR(&__fs) + SPIFFS_CFG_PHYS_SZ(&__fs)) {
|
if (addr + size > SPIFFS_CFG_PHYS_ADDR(&__fs) + SPIFFS_CFG_PHYS_SZ(&__fs)) {
|
||||||
printf("FATAL write addr too high %08x + %08x > %08x\n", addr, size, SPIFFS_PHYS_ADDR + SPIFFS_FLASH_SIZE);
|
printf("FATAL write addr too high %08x + %08x > %08x\n", addr, size, SPIFFS_PHYS_ADDR + SPIFFS_FLASH_SIZE);
|
||||||
ERREXIT();
|
ERREXIT();
|
||||||
exit(0);
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < size; i++) {
|
for (i = 0; i < size; i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user