Fix memory overflow error.

This commit is contained in:
carl 2019-03-26 00:59:16 +08:00
parent a09e40cba3
commit 496795f0cf

View file

@ -380,7 +380,7 @@ static void writeout(void)
} }
elem[sp_lmnem - sp_fmnem + 1] = nch; elem[sp_lmnem - sp_fmnem + 1] = nch;
printf("0 } ;\n\nchar *opindex[] = {\n"); printf("0 } ;\n\nchar *opindex[] = {\n");
for (i = 0; i <= sp_lmnem - sp_fmnem + 1; i++) for (i = 0; i < sp_lmnem - sp_fmnem + 1; i++)
{ {
printf(" &opchoice[%d], /* %d = %s */\n", elem[i], i, em_mnem[i]); printf(" &opchoice[%d], /* %d = %s */\n", elem[i], i, em_mnem[i]);
} }