Add function to verify a string contains a valid integer before we call strtol().