xmllite: It's acceptable to have NULL length pointer in GetLocalName().

This commit is contained in:
Nikolay Sivov 2013-06-12 13:06:24 +04:00 committed by Alexandre Julliard
parent 97cc8bfcc7
commit 9997ef3fbc
2 changed files with 9 additions and 2 deletions

View File

@ -2256,7 +2256,7 @@ static HRESULT WINAPI xmlreader_GetLocalName(IXmlReader* iface, LPCWSTR *name, U
TRACE("(%p)->(%p %p)\n", This, name, len);
*name = This->strvalues[StringValue_LocalName].str;
*len = This->strvalues[StringValue_LocalName].len;
if (len) *len = This->strvalues[StringValue_LocalName].len;
return S_OK;
}

View File

@ -1364,13 +1364,20 @@ static void test_read_cdata(void)
ok(type == XmlNodeType_CDATA, "got %d for %s\n", type, test->xml);
str_exp = a2w(test->name);
len = 1;
str = NULL;
hr = IXmlReader_GetLocalName(reader, &str, &len);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(len == strlen(test->name), "got %u\n", len);
str_exp = a2w(test->name);
ok(!lstrcmpW(str, str_exp), "got %s\n", wine_dbgstr_w(str));
str = NULL;
hr = IXmlReader_GetLocalName(reader, &str, NULL);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(!lstrcmpW(str, str_exp), "got %s\n", wine_dbgstr_w(str));
free_str(str_exp);
len = 1;