Commit 93acfeb7 authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

oleaut: Fix VarFormat for VT_NULL variants.

parent 7406cc21
......@@ -1785,10 +1785,8 @@ static void test_VarFormat(void)
/* VT_NULL */
V_VT(&in) = VT_NULL;
hres = pVarFormat(&in,NULL,fd,fw,0,&out);
todo_wine {
ok(hres == S_OK, "VarFormat failed with 0x%08lx\n", hres);
ok(out == NULL, "expected NULL formatted string\n");
}
/* Invalid args */
hres = pVarFormat(&in,NULL,fd,fw,flags,NULL);
......
......@@ -2007,6 +2007,9 @@ HRESULT WINAPI VarFormatFromTokens(LPVARIANT pVarIn, LPOLESTR lpszFormat,
if (!pVarIn || !rgbTok)
return E_INVALIDARG;
if (V_VT(pVarIn) == VT_NULL)
return S_OK;
if (*rgbTok == FMT_TO_STRING || header->type == FMT_TYPE_GENERAL)
{
/* According to MSDN, general format acts somewhat like the 'Str'
......
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