Skip to content

Commit

Permalink
Fix write callback of XmlStreamWriter wich did not work properly on W…
Browse files Browse the repository at this point in the history
…indows

Signed-off-by: Sébastien LAIGRE <[email protected]>
  • Loading branch information
sebalaig authored and gautierbureau committed Nov 16, 2023
1 parent 5a1abc8 commit b21d30e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/xml/XmlStreamWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,9 @@ void XmlStreamWriter::writeStartDocument(const std::string& encoding, const std:
auto writeCallback = [](void* context, const char* buffer, int len) {
XmlStreamWriter& writer = *static_cast<XmlStreamWriter*>(context);

size_t beforeWrite = writer.m_stream.tellp();
writer.m_stream.write(buffer, len);
size_t afterWrite = writer.m_stream.tellp();

return static_cast<int>(afterWrite - beforeWrite);
return len;
};

auto closeCallback = [](void* /*context*/) {
Expand Down

0 comments on commit b21d30e

Please sign in to comment.