Checking two arrays for equality.

Try:

if( ! (buffer[i] == buffer2[i]) ) {