Skip to content

Commit 071398c

Browse files
committed
Fix creation of binary image without defined bounds
1 parent 2700d89 commit 071398c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

IntelHex/Listeners/BinWriter.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ public BinWriter (Region inputRegion, Region outputRegion, byte fill, Stream des
5353
this.outputRegion = outputRegion;
5454
this.destination = destination;
5555

56-
buffer = Enumerable.Repeat(fill, (int)outputRegion.GetLength ()).ToArray();
5756
writtenRegions = new MemoryRegions ();
5857
written = new Region (0, 0);
5958

@@ -63,6 +62,8 @@ public BinWriter (Region inputRegion, Region outputRegion, byte fill, Stream des
6362
if (!this.outputRegion.HasExactEnd ()) {
6463
this.outputRegion.SetAddressEnd ((uint)this.inputRegion.GetAddressEnd ());
6564
}
65+
66+
buffer = Enumerable.Repeat (fill, (int)outputRegion.GetLength ()).ToArray ();
6667
}
6768

6869
public void Data (uint address, byte[] data)

0 commit comments

Comments
 (0)