From 123519741836d78a4c015fda944b8828f34e6530 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Wed, 7 Mar 2018 21:24:29 -0600 Subject: [PATCH] Only fprintf if we know stream is not NULL --- src/mos6502.dis.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mos6502.dis.c b/src/mos6502.dis.c index fa686db..35258da 100644 --- a/src/mos6502.dis.c +++ b/src/mos6502.dis.c @@ -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