Commit ea6e5174 authored by Akihiro Sagawa's avatar Akihiro Sagawa Committed by Alexandre Julliard

ntdll: Avoid using isdigit() for WCHARs.

Found with Coccinelle. Signed-off-by: 's avatarAkihiro Sagawa <sagawa.aki@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 553282a0
...@@ -410,6 +410,11 @@ static void pf_fixup_exponent( char *buf ) ...@@ -410,6 +410,11 @@ static void pf_fixup_exponent( char *buf )
} }
} }
static inline BOOL isDigit(WCHAR c)
{
return c >= '0' && c <= '9';
}
/********************************************************************* /*********************************************************************
* pf_vsnprintf (INTERNAL) * pf_vsnprintf (INTERNAL)
* *
...@@ -490,7 +495,7 @@ static int pf_vsnprintf( pf_output *out, const WCHAR *format, __ms_va_list valis ...@@ -490,7 +495,7 @@ static int pf_vsnprintf( pf_output *out, const WCHAR *format, __ms_va_list valis
} }
p++; p++;
} }
else while( isdigit(*p) ) else while( isDigit(*p) )
{ {
flags.FieldLength *= 10; flags.FieldLength *= 10;
flags.FieldLength += *p++ - '0'; flags.FieldLength += *p++ - '0';
...@@ -507,7 +512,7 @@ static int pf_vsnprintf( pf_output *out, const WCHAR *format, __ms_va_list valis ...@@ -507,7 +512,7 @@ static int pf_vsnprintf( pf_output *out, const WCHAR *format, __ms_va_list valis
flags.Precision = va_arg( valist, int ); flags.Precision = va_arg( valist, int );
p++; p++;
} }
else while( isdigit(*p) ) else while( isDigit(*p) )
{ {
flags.Precision *= 10; flags.Precision *= 10;
flags.Precision += *p++ - '0'; flags.Precision += *p++ - '0';
...@@ -531,7 +536,7 @@ static int pf_vsnprintf( pf_output *out, const WCHAR *format, __ms_va_list valis ...@@ -531,7 +536,7 @@ static int pf_vsnprintf( pf_output *out, const WCHAR *format, __ms_va_list valis
} }
else if( *(p+1) == '3' && *(p+2) == '2' ) else if( *(p+1) == '3' && *(p+2) == '2' )
p += 3; p += 3;
else if( isdigit(*(p+1)) || *(p+1) == 0 ) else if( isDigit(*(p+1)) || *(p+1) == 0 )
break; break;
else else
p++; p++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment