strip_colour: Prefer IsDigit to isdigit.
Unlike isdigit, IsDigit can safely be applied to 'char's. Arguments to isdigit needs a character cast to 'unsigned char' or EOF.
This commit is contained in:
parent
aba43ba823
commit
57b1cd5f6b
1 changed files with 8 additions and 8 deletions
|
@ -39,15 +39,15 @@ strip_colour(char *string)
|
|||
switch (*c)
|
||||
{
|
||||
case 3:
|
||||
if(isdigit(c[1]))
|
||||
if(IsDigit(c[1]))
|
||||
{
|
||||
c++;
|
||||
if(isdigit(c[1]))
|
||||
if(IsDigit(c[1]))
|
||||
c++;
|
||||
if(c[1] == ',' && isdigit(c[2]))
|
||||
if(c[1] == ',' && IsDigit(c[2]))
|
||||
{
|
||||
c += 2;
|
||||
if(isdigit(c[1]))
|
||||
if(IsDigit(c[1]))
|
||||
c++;
|
||||
}
|
||||
}
|
||||
|
@ -91,15 +91,15 @@ strip_unprintable(char *string)
|
|||
switch (*c)
|
||||
{
|
||||
case 3:
|
||||
if(isdigit(c[1]))
|
||||
if(IsDigit(c[1]))
|
||||
{
|
||||
c++;
|
||||
if(isdigit(c[1]))
|
||||
if(IsDigit(c[1]))
|
||||
c++;
|
||||
if(c[1] == ',' && isdigit(c[2]))
|
||||
if(c[1] == ',' && IsDigit(c[2]))
|
||||
{
|
||||
c += 2;
|
||||
if(isdigit(c[1]))
|
||||
if(IsDigit(c[1]))
|
||||
c++;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue