From cb47caa9aec8eb38815713696ad93351b17fc8bc Mon Sep 17 00:00:00 2001 From: j8takagi Date: Sat, 27 Feb 2010 00:26:19 +0900 Subject: [PATCH] =?utf8?q?=E5=BE=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/assemble.c | 2 +- src/cmd.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/assemble.c b/src/assemble.c index 0c13893..aedbb11 100644 --- a/src/assemble.c +++ b/src/assemble.c @@ -412,7 +412,7 @@ bool assemble(const char *file, PASS pass) char *line; FILE *fp; - if(create_cmdtype_code() == false) { + if(pass == FIRST && create_cmdtype_code() == false) { return false; } if((fp = fopen(file, "r")) == NULL) { diff --git a/src/cmd.c b/src/cmd.c index df93682..d684d06 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -68,7 +68,7 @@ bool create_cmdtype_code() int i; for(i = 0; i < cmdcodesize; i++) { - np = (CMDCODETAB *) malloc(sizeof(*np)); + np = malloc(sizeof(CMDCODETAB *)); if(np == NULL) { setcerr(122, NULL); /* cannot create hash table */ return false; @@ -133,7 +133,7 @@ bool create_code_type() int i; for(i = 0; i < cmdcodesize; i++) { - if((np = (CMDCODETAB *) malloc(sizeof(*np))) == NULL) { + if((np = malloc(sizeof(CMDCODETAB *))) == NULL) { setcerr(122, NULL); /* cannot create hash table */ return false; } -- 2.18.0