From f656c0e92ba6a746a6301bc8a26c6f5b5a4cdc3a Mon Sep 17 00:00:00 2001 From: j8takagi Date: Sun, 14 Feb 2010 02:20:09 +0900 Subject: [PATCH] =?utf8?q?=E3=82=AA=E3=83=96=E3=82=B8=E3=82=A7=E3=82=AF?= =?utf8?q?=E3=83=88=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=81=AE=E8=AA=AD?= =?utf8?q?=E8=BE=BC=E6=99=82=E3=80=81=E9=A0=98=E5=9F=9F=E3=81=8C=E8=B6=B3?= =?utf8?q?=E3=82=8A=E3=81=AA=E3=81=84=E5=A0=B4=E5=90=88=E3=81=AF=E3=81=99?= =?utf8?q?=E3=81=90=E3=82=A8=E3=83=A9=E3=83=BC201=E3=82=92=E7=99=BA?= =?utf8?q?=E7=94=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/comet2.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/comet2.c b/src/comet2.c index a3fc2a0..e2a9e3c 100644 --- a/src/comet2.c +++ b/src/comet2.c @@ -34,7 +34,11 @@ bool loadassemble(char *file) { perror(file); return false; } - endptr = startptr + fread(memory, sizeof(WORD), memsize, fp); + if((endptr = startptr + fread(memory, sizeof(WORD), memsize-startptr, fp)) == memsize) { + setcerr(201, NULL); /* Load object file - full of COMET II memory */ + fprintf(stderr, "Execute error - %d: %s\n", cerrno, cerrmsg); + return false; + } fclose(fp); return true; } -- 2.18.0