Skip to content

Commit 601c03c

Browse files
kasjernordicjm
authored andcommitted
mynewt: Fix flash_area_sector_from_off
Function was incorrectly filling sector data when offset was set to the beginning of the sector. It returned previous sector instead of correct one. Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
1 parent 763be6a commit 601c03c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

boot/mynewt/flash_map_backend/src/flash_map_extended.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ int flash_area_sector_from_off(off_t off, struct flash_sector *sector)
7070
if (start < fa->fa_off) {
7171
continue;
7272
}
73-
if (off >= start - fa->fa_off && off <= (start - fa->fa_off) + size) {
73+
if (off >= start - fa->fa_off && off < (start - fa->fa_off) + size) {
7474
sector->fs_off = start - fa->fa_off;
7575
sector->fs_size = size;
7676
rc = 0;

0 commit comments

Comments
 (0)