Permalink
Browse files

DOS FCB: Use record size of 128 if record size in the FCB was zero (f…

…rom DOSBox SVN). This fixes divide by zero when running mirrors/hornet/demos/1993/g/guesswho.zip
  • Loading branch information...
joncampbell123 committed Feb 11, 2018
1 parent 8f8a2c8 commit f5c33b87e6d695c53201693d837f174616720d4a
Showing with 1 addition and 0 deletions.
  1. +1 −0 src/dos/dos_files.cpp
@@ -1221,6 +1221,7 @@ bool DOS_FCBGetFileSize(Bit16u seg,Bit16u offset) {
Bit32u size = 0;
Files[handle]->Seek(&size,DOS_SEEK_END);
DOS_CloseFile(entry);fcb.GetSeqData(handle,rec_size);
if (rec_size == 0) rec_size = 128; //Use default if missing.
Bit32u random=(size/rec_size);
if (size % rec_size) random++;
fcb.SetRandom(random);

0 comments on commit f5c33b8

Please sign in to comment.