You don't want to return p2. p2 points to the end of the wrong string!