fix elf2hex segfault
This commit is contained in:
parent
8573fd190e
commit
167f49789b
|
@ -34,11 +34,11 @@ void htif_hexwriter_t::write_chunk(addr_t taddr, size_t len, const uint8_t* src)
|
|||
mem[taddr/width].resize(width,0);
|
||||
|
||||
for(size_t j = 0; j < width; j++)
|
||||
mem[taddr/width][j] = src[j];
|
||||
mem[taddr/width][j] = src ? src[j] : 0;
|
||||
|
||||
len -= width;
|
||||
taddr += width;
|
||||
src += width;
|
||||
if (src) src += width;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue