mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-19 12:40:30 +00:00
xmllite: Fixed buffer handling in reader_parse_reference.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
68aeee4d79
commit
a3d78064d9
|
@ -2122,6 +2122,7 @@ static HRESULT reader_parse_reference(xmlreader *reader)
|
|||
len = buffer->written - ((char*)ptr - buffer->data) - sizeof(WCHAR);
|
||||
memmove(start+1, ptr+1, len);
|
||||
buffer->cur = cur + 1;
|
||||
buffer->written -= (ptr - start) * sizeof(WCHAR);
|
||||
|
||||
*start = ch;
|
||||
}
|
||||
|
|
|
@ -2241,8 +2241,8 @@ static void test_namespaceuri(void)
|
|||
|
||||
static void test_read_charref(void)
|
||||
{
|
||||
static const char testA[] = "<a b=\"c\">dză</a>";
|
||||
static const WCHAR chardataW[] = {0x01f3,0x0103,0};
|
||||
static const char testA[] = "<a b=\"c\">dză></a>";
|
||||
static const WCHAR chardataW[] = {0x01f3,0x0103,'>',0};
|
||||
const WCHAR *value;
|
||||
IXmlReader *reader;
|
||||
XmlNodeType type;
|
||||
|
@ -2252,7 +2252,7 @@ static void test_read_charref(void)
|
|||
hr = CreateXmlReader(&IID_IXmlReader, (void **)&reader, NULL);
|
||||
ok(hr == S_OK, "S_OK, got %08x\n", hr);
|
||||
|
||||
stream = create_stream_on_data(testA, sizeof(testA));
|
||||
stream = create_stream_on_data(testA, sizeof(testA)-1);
|
||||
hr = IXmlReader_SetInput(reader, (IUnknown *)stream);
|
||||
ok(hr == S_OK, "got %08x\n", hr);
|
||||
|
||||
|
@ -2272,6 +2272,10 @@ static void test_read_charref(void)
|
|||
ok(hr == S_OK, "got %08x\n", hr);
|
||||
ok(type == XmlNodeType_EndElement, "Unexpected node type %d\n", type);
|
||||
|
||||
hr = IXmlReader_Read(reader, &type);
|
||||
ok(hr == S_FALSE, "got %08x\n", hr);
|
||||
ok(type == XmlNodeType_None, "Unexpected node type %d\n", type);
|
||||
|
||||
IXmlReader_Release(reader);
|
||||
IStream_Release(stream);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue