From d28cabe954c1f93dee3cb1b100e614e985a74cdb Mon Sep 17 00:00:00 2001 From: j8takagi Date: Thu, 28 Apr 2011 21:22:43 +0900 Subject: [PATCH] =?utf8?q?=E3=83=A9=E3=83=99=E3=83=AB=E3=81=AE=E7=A9=BA?= =?utf8?q?=E6=96=87=E5=AD=97=E3=82=92=E3=80=81NULL=E3=81=8B=E3=82=89'\0'?= =?utf8?q?=E3=81=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/assemble.c | 4 ++-- src/token.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/assemble.c b/src/assemble.c index 23ce8ac..9227114 100644 --- a/src/assemble.c +++ b/src/assemble.c @@ -257,7 +257,7 @@ void assemble_start(const CMDLINE *cmdl, PASS pass) setcerr(106, ""); /* operand count mismatch */ return; } - if(cmdl->label == '\0') { + if(*(cmdl->label) == '\0') { setcerr(107, ""); /* no label in START */ return; } @@ -604,7 +604,7 @@ bool assembleline(const char *line, PASS pass) stat = (cerr->num == 0) ? true : false; if(cmdl != NULL) { if(stat == true) { - if(pass == FIRST && cmdl->label != '\0') { + if(pass == FIRST && *(cmdl->label) != '\0') { stat = addlabel(asptr->prog, cmdl->label, asptr->ptr); } } diff --git a/src/token.c b/src/token.c index c9078d2..074b6c4 100644 --- a/src/token.c +++ b/src/token.c @@ -125,7 +125,7 @@ CMDLINE *linetok(const char *line) cmdl->label = malloc_chk(LABELSIZE + 1, "cmdl.label"); /* ラベルの取得。行の先頭が空白またはタブの場合、ラベルは空 */ if((sepp = p + strcspn(p, " \t\n")) == p){ - cmdl->label = '\0'; + *(cmdl->label) = '\0'; } else { /* ラベルを取得 */ *sepp = '\0'; /* 文字列が長すぎる場合はエラー */ @@ -141,7 +141,7 @@ CMDLINE *linetok(const char *line) } /* 命令とオペランドの取得 */ if(*p == '\n' || *p == '\0') { /* 命令がない場合は、終了 */ - if(cmdl->label != '\0') { /* ラベルが定義されていて命令がない場合はエラー */ + if(*(cmdl->label) != '\0') { /* ラベルが定義されていて命令がない場合はエラー */ setcerr(105, ""); /* no command in the line */ } FREE(cmdl->label); -- 2.18.0