Well, you can get your char* anyway you want. You don't need to use the custom getLine() call. The biggest part here for you was the change to the validate function which processed the entire char* vice char by char.