Fixed bug where vm_print_program listing for program was incorrect

Only happens when vm_print_program(STDERR), as STDERR occurs before
STDOUT on Emacs.  So while the lines would print, no instructions
would follow.  This fixes that by using fp.
This commit is contained in:
2023-10-23 00:08:53 +01:00
parent b44eaefabb
commit 45ad8f7296

View File

@@ -267,7 +267,7 @@ void vm_print_program(vm_t *vm, FILE *fp)
for (size_t i = beg; i < end; ++i)
{
fprintf(fp, "\t%lu: ", i);
inst_print(program.instructions[i], stdout);
inst_print(program.instructions[i], fp);
if (i == program.ptr)
fprintf(fp, " <---");
fprintf(fp, "\n");