Commit 81fe4bd8 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

vbscript: Use to_int in InStr implementation.

parent 4b00511c
...@@ -603,6 +603,7 @@ static HRESULT Global_InStr(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VA ...@@ -603,6 +603,7 @@ static HRESULT Global_InStr(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VA
VARIANT *startv, *str1v, *str2v; VARIANT *startv, *str1v, *str2v;
BSTR str1, str2; BSTR str1, str2;
int start, ret; int start, ret;
HRESULT hres;
TRACE("\n"); TRACE("\n");
...@@ -625,18 +626,9 @@ static HRESULT Global_InStr(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VA ...@@ -625,18 +626,9 @@ static HRESULT Global_InStr(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VA
} }
if(startv) { if(startv) {
/* FIXME: Move to helper */ hres = to_int(startv, &start);
switch(V_VT(startv)) { if(FAILED(hres))
case VT_I2: return hres;
start = V_I2(startv);
break;
case VT_I4:
start = V_I4(startv);
break;
default:
FIXME("unsupported start %s\n", debugstr_variant(startv));
return E_NOTIMPL;
}
if(--start < 0) { if(--start < 0) {
FIXME("start %d\n", start); FIXME("start %d\n", start);
return E_FAIL; return E_FAIL;
......
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