segment name fix

This commit is contained in:
Sean 2020-02-28 12:11:56 -07:00
parent b53b097f7f
commit c8b5738fb6
No known key found for this signature in database
GPG Key ID: B111C910D99B42B8
1 changed files with 5 additions and 1 deletions

View File

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