String Comparison

So I have the Parallex RFID module hooked up to my Arduino. It came with two RFID tags with two unique ID’s. I’m trying to check the currently scanned tag’s code against a “master code”. If they match more code will execute. Im using the strcmp method without much luck. Here is my current code, any help would be appreciated.

// RFID reader for Arduino 
// Wiring version by BARRAGAN <http://people.interaction-ivrea.it/h.barragan> 
// Modified for Arudino by djmatic

int rPin = 8;
int gPin = 9;
int  val = 0; 
int checkVal = 0;
char code[10]; 
char checkCode[11] = "0F03040281";

int bytesread = 0; 

void setup() { 

Serial.begin(2400); // RFID reader SOUT pin connected to Serial RX pin at 2400bps 
pinMode(rPin, OUTPUT);
pinMode(gPin, OUTPUT);
pinMode(2,OUTPUT);   // Set digital pin 2 as OUTPUT to connect it to the RFID /ENABLE pin 
digitalWrite(2, LOW);                  // Activate the RFID reader
}  


 void loop() { 

  if(Serial.available() > 0) {          // if data available from reader 
    if((val = Serial.read()) == 10) {   // check for header 
      bytesread = 0; 
      while(bytesread<10) {              // read 10 digit code 
        if( Serial.available() > 0) { 
          val = Serial.read(); 
          if((val == 10)||(val == 13)) { // if header or stop bytes before the 10 digit reading 
            break;                       // stop reading 
          } 
          code[bytesread] = val;         // add the digit           
          bytesread++;                   // ready to read next digit  
        } 
      }
      if(bytesread == 10) {        // if 10 digit read is complete 
        if(strcmp(code, checkCode) == 0){  // I've checked code against code.  It worked and printed good as expected.
          Serial.println("GOOD");
        }else{
          Serial.println("BAD");
        }
        Serial.print("TAG code is: ");   // possibly a good TAG 
        Serial.println(code);            // print the TAG code 
      }
      bytesread = 0; 
           delay(1000);                       // wait for a second 
    } 
  } 
} 

// extra stuff
// digitalWrite(2, HIGH);             // deactivate RFID reader

The code variable is an array of chars. To make it a string, for strcmp, it needs to be NULL terminated.

          code[bytesread] = val;         // add the digit          
          bytesread++;                   // ready to read next digit  
[glow]          code[bytesread] = '\0';[/glow]

THe code variable needs to be declared 1 larger to hold the terminating NULL, too.

I tried everything but that ::)

Thanks alot, I appreciate it.