diff --git a/src/dos/drive_iso.cpp b/src/dos/drive_iso.cpp index 6be88895..52e19d5e 100644 --- a/src/dos/drive_iso.cpp +++ b/src/dos/drive_iso.cpp @@ -494,13 +494,13 @@ int isoDrive :: readDirEntry(isoDirEntry *de, Bit8u *data) { if (de->ident[tmp - 1] == '.') de->ident[tmp - 1] = 0; } } - const char* dotpos = strchr((char*)de->ident, '.'); + char* dotpos = strchr((char*)de->ident, '.'); if (dotpos!=NULL) { + if (strlen(dotpos)>4) dotpos[4]=0; if (dotpos-(char*)de->ident>8) { strcpy((char*)(&de->ident[8]),dotpos); } - } - if (strlen((char*)de->ident)>12) de->ident[12]=0; + } else if (strlen((char*)de->ident)>8) de->ident[8]=0; return de->length; }