fix elf2hex segfault

This commit is contained in:
Andrew Waterman 2012-03-15 04:42:36 -07:00
parent 8573fd190e
commit 167f49789b
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}
}