errno == ERANGE;
errno = ERANGE;
int safe_atoi(const char *str, int *result){	long int lresult;	char *endptr;	assert(str != NULL);	assert(result != NULL);#ifdef HAVE_STRTOL	errno = 0;	lresult = strtol(str, &endptr, 10);	if (*endptr != '\0') {		errno = EINVAL;		return -1;	}	if (errno == ERANGE || lresult > INT_MAX || lresult < INT_MIN) {		errno == ERANGE;		return -1;	}#else	for (endptr = str; *endptr != '\0'; ++endptr) {		if (!isdigit(*endptr)) {			errno = EINVAL;			return -1;		}	}	lresult = atoi(str);#endif		*result = lresult;	return 0;}