projects
/
YACASL2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
285d44a
)
オブジェクトファイルの読込時、領域が足りない場合はすぐエラー201を発生
author
j8takagi
<j8takagi@nifty.com>
Sat, 13 Feb 2010 17:20:09 +0000
(
02:20
+0900)
committer
j8takagi
<j8takagi@nifty.com>
Sat, 13 Feb 2010 17:20:09 +0000
(
02:20
+0900)
src/comet2.c
patch
|
blob
|
history
diff --git
a/src/comet2.c
b/src/comet2.c
index
a3fc2a0
..
e2a9e3c
100644
(file)
--- 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;
}