diff --git a/equi.c b/equi.c index a7ab19f..d3dd08c 100644 --- a/equi.c +++ b/equi.c @@ -565,7 +565,7 @@ int main(int argc, char* argv[]) { } else if(!ram.II && (instr == 0xFFU || instr == INS_QUIT)) { /* if not in II mode, process EOF or Q instruction: trigger interpreter loop */ cputc(CR); /* echo CR */ cputc(LF); /* echo LF */ - ram.cmdbuf[+ram.ibp] = 0; /* end program with 0 */ + ram.cmdbuf[++ram.ibp] = INS_QUIT; /* end program with INS_QUIT */ ram.IM = 1; /* set the mandatory interpretation mode flag */ equi_main_loop(); /* and run the interpreter loop */ cputc(CR); /* echo CR */