From 8804d363f88a31ed90db267aaac9f98c820fcc3c Mon Sep 17 00:00:00 2001 From: Brad Grantham Date: Tue, 15 Nov 2016 10:34:12 -0800 Subject: [PATCH] use strcmp instead of == --- d6502.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/d6502.c b/d6502.c index 77ed74c..f7b70e0 100644 --- a/d6502.c +++ b/d6502.c @@ -2,6 +2,7 @@ #include #include +#include int main(int argc, char **argv) { @@ -109,14 +110,14 @@ printf("%02X ", currentbyte); //Display the current byte in HEX if (paramcount == 0) { printf(" %s %s %s", pad, opcode, pre); //Pad text, display instruction name and pre-operand chars - if (pad == " ") { //Check if single operand instruction + if (strcmp(pad, " ") == 0) { //Check if single operand instruction if (addrmode != 8) { //If not using relative addressing ... printf("$%02X", currentbyte); //...display operand } else { //Addressing mode is relative... printf("$%02X", (address + ((currentbyte < 128) ? currentbyte : currentbyte - 256))); //...display relative address. } } - if (pad == "") //Check if two operand instruction and if so... + if (strcmp(pad, "") == 0) //Check if two operand instruction and if so... printf("$%02X%02X", currentbyte, previousbyte); //...display operand printf("%s\n", post); //Display post-operand chars }