If you don't get the CR/LF transmitted, why not use some other terminator, like full-stop (period) and "break" on that?
Then you can be sure you've got a complete command, and you don't need the impure nasty delay. ![]()
You can even put it into the string, and it'll be ignored by "atoi".