strto*() is the wrong API to use if you care about errors.
char* forty_two = 42;
int i;
if (sscanf (forty_two, "%d", &i) != 1) {
/* error */
}
Sometimes, there's more than one way to skin a cat, and one of them is more suited to the task at hand.