diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index 1f8afb46fe8..c680ae23c3e 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -1694,17 +1694,17 @@ static WCHAR *convert_bios_date( const WCHAR *str ) while (len && iswspace( p[len - 1] )) { len--; } q = p; - while (len && iswdigit( *q )) { q++; len--; }; + while (len && is_digit( *q )) { q++; len--; }; if (q - p != 2 || !len || *q != '/') return NULL; month = (p[0] - '0') * 10 + p[1] - '0'; p = ++q; len--; - while (len && iswdigit( *q )) { q++; len--; }; + while (len && is_digit( *q )) { q++; len--; }; if (q - p != 2 || !len || *q != '/') return NULL; day = (p[0] - '0') * 10 + p[1] - '0'; p = ++q; len--; - while (len && iswdigit( *q )) { q++; len--; }; + while (len && is_digit( *q )) { q++; len--; }; if (q - p == 4) year = (p[0] - '0') * 1000 + (p[1] - '0') * 100 + (p[2] - '0') * 10 + p[3] - '0'; else if (q - p == 2) year = 1900 + (p[0] - '0') * 10 + p[1] - '0'; else return NULL; diff --git a/dlls/wbemprox/wbemprox_private.h b/dlls/wbemprox/wbemprox_private.h index 9096b392e38..57ac793a4ea 100644 --- a/dlls/wbemprox/wbemprox_private.h +++ b/dlls/wbemprox/wbemprox_private.h @@ -272,6 +272,11 @@ static inline WCHAR *heap_strdupAW( const char *src ) return dst; } +static inline BOOL is_digit(WCHAR c) +{ + return '0' <= c && c <= '9'; +} + static const WCHAR class_processW[] = {'W','i','n','3','2','_','P','r','o','c','e','s','s',0}; static const WCHAR class_serviceW[] = {'W','i','n','3','2','_','S','e','r','v','i','c','e',0}; static const WCHAR class_stdregprovW[] = {'S','t','d','R','e','g','P','r','o','v',0}; diff --git a/dlls/wbemprox/wql.y b/dlls/wbemprox/wql.y index 0fae44da2eb..f5b249aaba4 100644 --- a/dlls/wbemprox/wql.y +++ b/dlls/wbemprox/wql.y @@ -785,7 +785,7 @@ static int get_token( const WCHAR *s, int *token ) *token = TK_STRING; return i; case '.': - if (!iswdigit( s[1] )) + if (!is_digit( s[1] )) { *token = TK_DOT; return 1; @@ -794,7 +794,7 @@ static int get_token( const WCHAR *s, int *token ) case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': *token = TK_INTEGER; - for (i = 1; iswdigit( s[i] ); i++) {} + for (i = 1; is_digit( s[i] ); i++) {} return i; default: if (!id_char[*s]) break;