From c8b5738fb6d49bfd6a2b7d091dfc26ac440de8eb Mon Sep 17 00:00:00 2001 From: Sean Date: Fri, 28 Feb 2020 12:11:56 -0700 Subject: [PATCH] segment name fix --- src/omf.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/omf.cc b/src/omf.cc index 44a3783..c39f48f 100644 --- a/src/omf.cc +++ b/src/omf.cc @@ -101,8 +101,12 @@ bool OMF::loadSegments() { seg.lablen = 0xa; } } - handle->seek(ofs + dispname + seg.lablen); // skip past load name + // check if load name is valid + handle->seek(ofs + dispname); seg.name = handle->read(seg.lablen); + if (seg.name[0] == 0 || seg.name[0] == ' ') { // invalid name use segname + seg.name = handle->read(seg.lablen); + } seg.offset = ofs + dispdata; if (version == 1) { // convert to v2 seg.bytecnt *= 512;