fs Fix bug, check if fs_read() returned < 0

This commit is contained in:
2025-11-09 23:06:18 +01:00
parent 4084336705
commit 6da93cd854

View File

@ -60,7 +60,7 @@ void fs_fetch(void) {
uint8_t *buf = umalloc(statbuf.size+1); uint8_t *buf = umalloc(statbuf.size+1);
string_memset(buf, 0, statbuf.size+1); string_memset(buf, 0, statbuf.size+1);
if (fs_read(h, buf, statbuf.size, 0)) { if (fs_read(h, buf, statbuf.size, 0) < 0) {
uprintf("fs: coult not read %s\n", path); uprintf("fs: coult not read %s\n", path);
goto donefile; goto donefile;
return; return;