In the code snippet:
int Z;
boolean ParsedOk;
ParsedOk = sscanf( CommandLine, "%i", &Z ) == 1;
I find that a successful parse occurs for both valid numbers, but also for numbers that have trailing rubbish, such as '3Q', etc.
How can I detect (and reject) such malformed numerical input?