minor mods
This commit is contained in:
parent
528ec8869b
commit
8a5f7d09c9
|
@ -9,8 +9,7 @@ static
|
||||||
is_oct(c)
|
is_oct(c)
|
||||||
char c;
|
char c;
|
||||||
{
|
{
|
||||||
return (c == '0' || c == '1' || c == '2' || c == '3' ||
|
return ((unsigned int)(c-'0') <= ('7'-'0'));
|
||||||
c == '4' || c == '5' || c == '6' || c == '7');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* str2bts() strips the escaped characters of a
|
/* str2bts() strips the escaped characters of a
|
||||||
|
|
|
@ -10,12 +10,14 @@ value(c, b)
|
||||||
char c;
|
char c;
|
||||||
int b;
|
int b;
|
||||||
{
|
{
|
||||||
if (c >= '0' && c <= '9')
|
register int ch;
|
||||||
return c - '0';
|
|
||||||
if (c >= 'A' && c <= 'F')
|
ch = c - '0';
|
||||||
return c - 'A' + 10;
|
if ((unsigned) ch <= 9) return ch;
|
||||||
if (c >= 'a' && c <= 'f')
|
ch = c - 'A';
|
||||||
return c - 'a' + 10;
|
if ((unsigned) ch <= 5) return ch + 10;
|
||||||
|
ch = c - 'a';
|
||||||
|
if ((unsigned) ch <= 5) return ch + 10;
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue