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.
pull/12446/head
Stephan Brunner 2020-02-17 20:57:36 +01:00
parent e850984715
commit 267d8cc223
No known key found for this signature in database
GPG Key ID: D3CD7237AFB7EF6B
1 changed files with 2 additions and 1 deletions

View File

@ -160,7 +160,8 @@ int I2CEEBlockDevice::program(const void *buffer, bd_addr_t addr, bd_size_t size
return BD_ERROR_OK;
};
return do_paged(addr, size, handler);
auto const originalSize = size;
return do_paged(addr, originalSize, handler);
}
int I2CEEBlockDevice::erase(bd_addr_t addr, bd_size_t size)