src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
/*
 * This is a stripped-down version of strtoull, suitable only for converting
 * lowercase hexadecimal numbers that don't overflow.
 */
This is a stripped-down version of strtoull, suitable only for converting
lowercase hexadecimal numbers that don't overflow.
This is a stripped - down version of strtoull suitable only for converting lowercase hexadecimal numbers that don ' t overflow .
uint64_t
zfs_strtonum(const char *str, char **nptr)
{
	uint64_t val = 0;
	char c;
	int digit;
	while ((c = *str) != '\0') {
		if (c >= '0' && c <= '9')
			digit = c - '0';
		else if (c >= 'a' && c <= 'f')
			digit = 10 + c - 'a';
		else
			break;
		val *= 16;
		val += digit;
		str++;
	}
	if (nptr)
		*nptr = (char *)str;
	return (val);
}
uint64_t zfs_strtonum ( const char * str , char * * nptr ) { uint64_t val = 0 ; char c ; int digit ; while ( ( c = * str ) != ' \0 ' ) { if ( c >= ' ' && c <= ' ' ) digit = c - ' ' ; else if ( c >= ' ' && c <= ' ' ) digit = 10 + c - ' ' ; else break ; val *= 16 ; val += digit ; str ++ ; } if ( nptr ) * nptr = ( char * ) str ; return ( val ) ; }
This is a stripped-down version of strtoull, suitable only for converting
 lowercase hexadecimal numbers that don't overflow.
This is a stripped - down version of strtoull suitable only for converting lowercase hexadecimal numbers that don ' t overflow .