From 600e02b1b45d7c5bd2b9725f60bf2bd556a8157c Mon Sep 17 00:00:00 2001 From: Bart Oldeman Date: Sun, 21 Mar 2004 15:31:45 +0000 Subject: [PATCH] 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 --- kernel/task.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/task.c b/kernel/task.c index ec03b69..e3d5ed0 100644 --- a/kernel/task.c +++ b/kernel/task.c @@ -659,8 +659,8 @@ COUNT DosExeLoader(BYTE FAR * namep, exec_blk * exp, COUNT mode, COUNT fd) if (mode != OVERLAY) { exe_size -= sizeof(psp) / 16; - start_seg += sizeof(psp) /16; - if (exe_size > 0 && (ExeHeader.exMinAlloc == 0) && (ExeHeader.exMaxAlloc == 0)) + start_seg += sizeof(psp) / 16; + if (exe_size > 0 && (ExeHeader.exMinAlloc | ExeHeader.exMaxAlloc) == 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; seg sp = start_seg; - while (toRead == CHUNK) + while (1) { if (exe_size < CHUNK/16) toRead = exe_size*16; nBytesRead = (int)DosRWSft(fd, toRead, MK_FP(sp, 0), XFR_READ); - if (nBytesRead < toRead) + if (nBytesRead < toRead || exe_size <= CHUNK/16) break; sp += CHUNK/16; exe_size -= CHUNK/16;