1
0
mirror of https://github.com/pevans/erc-c.git synced 2024-06-16 06:29:37 +00:00

Only fprintf if we know stream is not NULL

This commit is contained in:
Peter Evans 2018-03-07 21:24:29 -06:00
parent dda7ae6288
commit 1235197418

View File

@ -325,10 +325,10 @@ mos6502_dis_opcode(mos6502 *cpu, FILE *stream, int address)
} else {
snprintf(s_bytes, sizeof(s_bytes) - 1, "%02X", opcode);
}
}
fprintf(stream, "%04X:%-9s%20s %s\n",
cpu->PC, s_bytes, s_inst, s_operand);
fprintf(stream, "%04X:%-9s%20s %s\n",
cpu->PC, s_bytes, s_inst, s_operand);
}
// The expected number of bytes here is for the operand, but we need
// to add one for the opcode to return the true number that this