A few suggestions from Arkady. Saves 5 bytes.

git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@808 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
Bart Oldeman 2004-03-21 15:31:45 +00:00
parent 82261c0caf
commit 600e02b1b4
1 changed files with 4 additions and 4 deletions

View File

@ -659,8 +659,8 @@ COUNT DosExeLoader(BYTE FAR * namep, exec_blk * exp, COUNT mode, COUNT fd)
if (mode != OVERLAY) if (mode != OVERLAY)
{ {
exe_size -= sizeof(psp) / 16; exe_size -= sizeof(psp) / 16;
start_seg += sizeof(psp) /16; start_seg += sizeof(psp) / 16;
if (exe_size > 0 && (ExeHeader.exMinAlloc == 0) && (ExeHeader.exMaxAlloc == 0)) if (exe_size > 0 && (ExeHeader.exMinAlloc | ExeHeader.exMaxAlloc) == 0)
{ {
mcb FAR *mp = MK_FP(mem - 1, 0); mcb FAR *mp = MK_FP(mem - 1, 0);
@ -675,12 +675,12 @@ COUNT DosExeLoader(BYTE FAR * namep, exec_blk * exp, COUNT mode, COUNT fd)
int nBytesRead, toRead = CHUNK; int nBytesRead, toRead = CHUNK;
seg sp = start_seg; seg sp = start_seg;
while (toRead == CHUNK) while (1)
{ {
if (exe_size < CHUNK/16) if (exe_size < CHUNK/16)
toRead = exe_size*16; toRead = exe_size*16;
nBytesRead = (int)DosRWSft(fd, toRead, MK_FP(sp, 0), XFR_READ); nBytesRead = (int)DosRWSft(fd, toRead, MK_FP(sp, 0), XFR_READ);
if (nBytesRead < toRead) if (nBytesRead < toRead || exe_size <= CHUNK/16)
break; break;
sp += CHUNK/16; sp += CHUNK/16;
exe_size -= CHUNK/16; exe_size -= CHUNK/16;