mallocのサイズ指定誤りを修正
[YACASL2.git] / src / casl2.c
index 47490a1..79d3e02 100644 (file)
@@ -65,7 +65,7 @@ void assemble(int filec, char *filev[])
 
     create_cmdtype_code();                         /* 命令の名前とタイプがキーのハッシュ表を作成 */
     asptr = malloc_chk(sizeof(ASPTR), "asptr");    /* アセンブル時のプロパティ用の領域確保 */
-    asptr->prog = malloc_chk(sizeof(LABELSIZE + 1), "asptr.prog");
+    asptr->prog = malloc_chk(LABELSIZE + 1, "asptr.prog");
     asptr->ptr = 0;
     /* アセンブル。ラベル表作成のため、2回行う */
     for(pass = FIRST; pass <= SECOND; pass++) {