Commit 4873dd49 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Fix checks for digit characters.

parent b680571a
......@@ -822,7 +822,7 @@ static HRESULT exec_composesettings(HTMLDocumentNode *doc, DWORD cmdexecopt, VAR
if(!ptr)
return S_OK;
if(iswdigit(*++ptr)) {
if(is_digit(*++ptr)) {
VARIANT v;
V_VT(&v) = VT_I4;
......
......@@ -95,7 +95,7 @@ static int comp_value(const WCHAR *ptr, int dpc)
while(dpc--) {
if(!*ptr)
ret *= 16;
else if(iswdigit(ch = *ptr++))
else if(is_digit(ch = *ptr++))
ret = ret*16 + (ch-'0');
else if('a' <= ch && ch <= 'f')
ret = ret*16 + (ch-'a') + 10;
......
......@@ -700,7 +700,7 @@ static HRESULT HTMLRectCollection_get_dispid(DispatchEx *dispex, BSTR name, DWOR
DWORD idx = 0;
WCHAR *ptr;
for(ptr = name; *ptr && iswdigit(*ptr); ptr++)
for(ptr = name; *ptr && is_digit(*ptr); ptr++)
idx = idx*10 + (*ptr-'0');
if(*ptr)
return DISP_E_UNKNOWNNAME;
......@@ -6061,7 +6061,7 @@ static HRESULT HTMLFiltersCollection_get_dispid(DispatchEx *dispex, BSTR name, D
WCHAR *ptr;
int idx = 0;
for(ptr = name; *ptr && iswdigit(*ptr); ptr++)
for(ptr = name; *ptr && is_digit(*ptr); ptr++)
idx = idx*10 + (*ptr-'0');
if(*ptr)
return DISP_E_UNKNOWNNAME;
......
......@@ -562,7 +562,7 @@ static HRESULT HTMLElementCollection_get_dispid(DispatchEx *dispex, BSTR name, D
if(!*name)
return DISP_E_UNKNOWNNAME;
for(ptr = name; *ptr && iswdigit(*ptr); ptr++)
for(ptr = name; *ptr && is_digit(*ptr); ptr++)
idx = idx*10 + (*ptr-'0');
if(*ptr) {
......
......@@ -373,7 +373,7 @@ static HRESULT HTMLDOMChildrenCollection_get_dispid(DispatchEx *dispex, BSTR nam
DWORD idx=0;
UINT32 len = 0;
for(ptr = name; *ptr && iswdigit(*ptr); ptr++)
for(ptr = name; *ptr && is_digit(*ptr); ptr++)
idx = idx*10 + (*ptr-'0');
if(*ptr)
return DISP_E_UNKNOWNNAME;
......
......@@ -1190,7 +1190,7 @@ static HRESULT HTMLSelectElement_get_dispid(HTMLDOMNode *iface, BSTR name, DWORD
const WCHAR *ptr;
DWORD idx = 0;
for(ptr = name; *ptr && iswdigit(*ptr); ptr++) {
for(ptr = name; *ptr && is_digit(*ptr); ptr++) {
idx = idx*10 + (*ptr-'0');
if(idx > MSHTML_CUSTOM_DISPID_CNT) {
WARN("too big idx\n");
......
......@@ -871,7 +871,7 @@ static void fix_px_value(nsAString *nsstr)
if(!*ptr)
break;
while(*ptr && iswdigit(*ptr))
while(*ptr && is_digit(*ptr))
ptr++;
if(!*ptr || iswspace(*ptr)) {
......@@ -1096,7 +1096,7 @@ static HRESULT get_nsstyle_property_var(nsIDOMCSSStyleDeclaration *nsstyle, styl
ptr++;
}
while(iswdigit(*ptr))
while(is_digit(*ptr))
i = i*10 + (*ptr++ - '0');
if(!*ptr) {
......@@ -1228,7 +1228,7 @@ static HRESULT get_nsstyle_pixel_val(HTMLStyle *This, styleid_t sid, LONG *p)
if(*ptr == '.') {
/* Skip all digits. We have tests showing that we should not round the value. */
while(iswdigit(*++ptr));
while(is_digit(*++ptr));
}
}
......@@ -2953,11 +2953,11 @@ static void update_filter(HTMLStyle *This)
ptr2 += ARRAY_SIZE(opacityW);
while(iswdigit(*ptr2))
while(is_digit(*ptr2))
fval = fval*10.0f + (float)(*ptr2++ - '0');
if(*ptr2 == '.') {
while(iswdigit(*++ptr2)) {
while(is_digit(*++ptr2)) {
fval += e * (float)(*ptr2++ - '0');
e *= 0.1f;
}
......
......@@ -1021,9 +1021,9 @@ static HRESULT nsstr_to_truncated_bstr(const nsAString *nsstr, BSTR *ret_ptr)
nsAString_GetData(nsstr, &str);
for(ptr = str; iswdigit(*ptr); ptr++);
for(ptr = str; is_digit(*ptr); ptr++);
if(*ptr == '.') {
for(end = ptr++; iswdigit(*ptr); ptr++);
for(end = ptr++; is_digit(*ptr); ptr++);
if(*ptr)
end = NULL;
}
......
......@@ -1363,6 +1363,11 @@ static inline VARIANT_BOOL variant_bool(BOOL b)
return b ? VARIANT_TRUE : VARIANT_FALSE;
}
static inline BOOL is_digit(WCHAR c)
{
return '0' <= c && c <= '9';
}
#ifdef __i386__
extern void *call_thiscall_func;
#endif
......
......@@ -109,16 +109,16 @@ static PRUnichar *handle_insert_comment(HTMLDocumentNode *doc, const PRUnichar *
while(iswspace(*ptr))
ptr++;
if(!iswdigit(*ptr))
if(!is_digit(*ptr))
return NULL;
while(iswdigit(*ptr))
while(is_digit(*ptr))
majorv = majorv*10 + (*ptr++ - '0');
if(*ptr == '.') {
ptr++;
if(!iswdigit(*ptr))
if(!is_digit(*ptr))
return NULL;
while(iswdigit(*ptr))
while(is_digit(*ptr))
minorv = minorv*10 + (*ptr++ - '0');
}
......
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