Commit 40b4aa07 authored by Fabio Utzig's avatar Fabio Utzig Committed by David Brown
Browse files

Fix offset print writing to non-erased area

Signed-off-by: default avatarFabio Utzig <utzig@apache.org>
parent ba5d3a7d
Loading
Loading
Loading
Loading
+2 −1
Changes for sim/src/flash.rs: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -107,7 +107,8 @@ impl Flash {

        for (i, x) in &mut self.write_safe[offset .. offset + payload.len()].iter_mut().enumerate() {
            if !(*x) {
                bail!(ewrite(format!("Write to unerased location at 0x{:x}", i)));
                bail!(ewrite(format!("Write to unerased location at 0x{:x}",
                                     offset + i)));
            }
            *x = false;
        }