mi/util.c
// wrapper around strtol, with additional error checking
// and simplified interface.
wrapper around strtol, with additional error checking
and simplified interface.
wrapper around strtol with additional error checking and simplified interface .
int32_t ata_strtolong(char * src, long * dest)
{
	long val = strtol(src, NULL, 10);
	int32_t rc = -1;
	if( ! ((errno == EINVAL) || (errno == ERANGE)) ) {
		rc = 0;
		*dest = val;
	}
	return rc;
}
int32_t ata_strtolong ( char * src , long * dest ) { long val = strtol ( src , NULL , 10 ) ; int32_t rc = -1 ; if ( ! ( ( errno == EINVAL ) || ( errno == ERANGE ) ) ) { rc = 0 ; * dest = val ; } return rc ; }
wrapper around strtol, with additional error checking
and simplified interface.
wrapper around strtol with additional error checking and simplified interface .