Reading Mixed Serial If/Else ? ?

aarg:
Here is a non-blocking AT response check I coded recently:

boolean foundOK()

{
 const char targetString[] = {'O', 'K', '\r', '\n'};
 static byte index = 0;
 boolean found = false;

while (Serial3.available() > 0)
 {
   c = Serial3.read();
   Serial.write(c);
   if (c == targetString[index])
   {
     index++;
     if (index >= sizeof(targetString))
     {
       index = 0;
       Serial.println("found "OK" termination string");
       found = true;
     }
   }
 }
 return found;
}

could you provide a bit more of the code I could look over to see how it worked with the rest of the sketch?