You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ma...@apache.org on 2017/01/20 18:24:59 UTC
[10/12] incubator-mynewt-core git commit: Fix bug written at the end
of buffer
Fix bug written at the end of buffer
Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/54ee5ce9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/54ee5ce9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/54ee5ce9
Branch: refs/heads/develop
Commit: 54ee5ce9c94f6c2a729aedbbc370696a388bf51d
Parents: 3f6222c
Author: Fabio Utzig <ut...@utzig.org>
Authored: Tue Jan 3 23:12:58 2017 -0200
Committer: Fabio Utzig <ut...@utzig.org>
Committed: Fri Jan 20 07:27:40 2017 -0200
----------------------------------------------------------------------
hw/drivers/flash/src/flash.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/54ee5ce9/hw/drivers/flash/src/flash.c
----------------------------------------------------------------------
diff --git a/hw/drivers/flash/src/flash.c b/hw/drivers/flash/src/flash.c
index 0ffa2cc..40e1706 100644
--- a/hw/drivers/flash/src/flash.c
+++ b/hw/drivers/flash/src/flash.c
@@ -405,7 +405,7 @@ flash_write(uint8_t flash_id, uint32_t addr, const void *buf, size_t len)
/**
* Write back extra stuff at the ending of page.
*/
- if (len < PAGE_SIZE) {
+ if (bfa + len < PAGE_SIZE) {
for (n = len; n < PAGE_SIZE; n++) {
hal_spi_tx_val(dev->spi_num, g_page_buffer[n]);
}