As far as the Arduino code goes, there is literally arbitrary code following that, I use it in many of my sketches.
I was under the impression that my code was immune to arduino reading incoming bytes too fast. As the inner while loop specifically keeps checking the incoming chars until the strings match.