tutorial.cpp: fix insitu parsing (closes #273)
The insitu parsing example in the tutorial is using a local char buffer inside a nested scope. After leaving the scope, the resulting Document object still references this (now invalid) memory locations. Some compilers reuse this space on the stack for other local variables later in the function, corrupting the original document. Drop the local scope to extend the lifetime of the buffer.
Showing
Please
register
or
sign in
to comment