Cryptography Reference
In-Depth Information
int
str2clint_l (CLINT n_l, char *str, USHORT base)
{
USHORT n;
int error = E_CLINT_OK;
if (str == NULL)
{
return E_CLINT_NPT;
}
if (2 > base || base > 16)
{
return E_CLINT_BOR;
/* error: invalid base */
}
SETZERO_L (n_l);
if (*str == '0')
{
if ((tolower_l(*(str+1)) == 'x') ||
(tolower_l(*(str+1)) == 'b'))
/* ignore any prefix */
{
++str;
++str;
}
}
while (isxdigit ((int)*str) || isspace ((int)*str))
{
if (!isspace ((int)*str))
{
n = (USHORT)tolower_l (*str);
Many implementations of tolower() from non-ANSI-conforming C libraries re-
turn undefined results if a character is not uppercase. The FLINT/C function
tolower_l() calls tolower() only for uppercase A-Z and otherwise returns the
character unchanged.
Search WWH ::




Custom Search