Commit fdc766be authored by Arnim Läuger's avatar Arnim Läuger Committed by Marcel Stör
Browse files

fix vfs_lseek() result checking in enduser_setup and clarify SPIFFS_lseek() return value (#1570)

parent 058777ea
...@@ -424,7 +424,7 @@ static int enduser_setup_http_load_payload(void) ...@@ -424,7 +424,7 @@ static int enduser_setup_http_load_payload(void)
c_sprintf(cl_hdr, http_header_content_len_fmt, file_len); c_sprintf(cl_hdr, http_header_content_len_fmt, file_len);
size_t cl_len = c_strlen(cl_hdr); size_t cl_len = c_strlen(cl_hdr);
if (!f || err != VFS_RES_OK || err2 != VFS_RES_OK) if (!f || err == VFS_RES_ERR || err2 == VFS_RES_ERR)
{ {
ENDUSER_SETUP_DEBUG("enduser_setup_http_load_payload unable to load file enduser_setup.html, loading backup HTML."); ENDUSER_SETUP_DEBUG("enduser_setup_http_load_payload unable to load file enduser_setup.html, loading backup HTML.");
......
...@@ -459,7 +459,8 @@ static sint32_t myspiffs_vfs_lseek( const struct vfs_file *fd, sint32_t off, int ...@@ -459,7 +459,8 @@ static sint32_t myspiffs_vfs_lseek( const struct vfs_file *fd, sint32_t off, int
break; break;
} }
return SPIFFS_lseek( &fs, fh, off, spiffs_whence ); sint32_t res = SPIFFS_lseek( &fs, fh, off, spiffs_whence );
return res >= 0 ? res : VFS_RES_ERR;
} }
static sint32_t myspiffs_vfs_eof( const struct vfs_file *fd ) { static sint32_t myspiffs_vfs_eof( const struct vfs_file *fd ) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment