Skip to content

Commit 267d8cc

Browse files
committed
Preserve original size as it is modified inside the handler function.
The value is const reference bound inside do_paged and must not be modified, it is used inside the paging loop.
1 parent e850984 commit 267d8cc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

components/storage/blockdevice/COMPONENT_I2CEE/I2CEEBlockDevice.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ int I2CEEBlockDevice::program(const void *buffer, bd_addr_t addr, bd_size_t size
160160
return BD_ERROR_OK;
161161
};
162162

163-
return do_paged(addr, size, handler);
163+
auto const originalSize = size;
164+
return do_paged(addr, originalSize, handler);
164165
}
165166

166167
int I2CEEBlockDevice::erase(bd_addr_t addr, bd_size_t size)

0 commit comments

Comments
 (0)