Just messing around with a program I'm currently working on and I stumble upon this. The program is of the client-server type so the client asks the user for commands and the server performs all the executions. If the "exit" command is entered the client will stop. I'm using
if (strncmp ("exit", command, strlen (command) - 1)) == 0)
{
//Perform exit code
}
to check if "exit" has been entered. If I enter "a " the program exits as if "exit" has been entered. Not a big deal, just wondering why it's happening.
Thanks.