File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -1020,10 +1020,19 @@ int romfs_fileconfigure(FAR struct romfs_mountpt_s *rm,
1020
1020
}
1021
1021
else
1022
1022
{
1023
+ uint32_t startsector ;
1024
+ uint32_t endoffset ;
1023
1025
uint32_t nsectors ;
1024
1026
1025
- rf -> rf_endsector = SEC_NSECTORS (rm , rf -> rf_startoffset + rf -> rf_size );
1026
- nsectors = rf -> rf_endsector - SEC_NSECTORS (rm , rf -> rf_startoffset ) + 1 ;
1027
+ endoffset = rf -> rf_startoffset + rf -> rf_size ;
1028
+ if (rf -> rf_size )
1029
+ {
1030
+ endoffset -- ;
1031
+ }
1032
+
1033
+ rf -> rf_endsector = SEC_NSECTORS (rm , endoffset );
1034
+ startsector = SEC_NSECTORS (rm , rf -> rf_startoffset );
1035
+ nsectors = rf -> rf_endsector - startsector + 1 ;
1027
1036
if (nsectors > CONFIG_FS_ROMFS_CACHE_FILE_NSECTORS )
1028
1037
{
1029
1038
nsectors = CONFIG_FS_ROMFS_CACHE_FILE_NSECTORS ;
You can’t perform that action at this time.
0 commit comments