summaryrefslogtreecommitdiff
path: root/src/writer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/writer.c')
-rw-r--r--src/writer.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/writer.c b/src/writer.c
index 2131372..ec0e477 100644
--- a/src/writer.c
+++ b/src/writer.c
@@ -37,6 +37,9 @@ yaml_emitter_flush(yaml_emitter_t *emitter)
assert(emitter->write_handler); /* Write handler must be set. */
assert(emitter->encoding); /* Output encoding must be set. */
+ emitter->buffer.last = emitter->buffer.pointer;
+ emitter->buffer.pointer = emitter->buffer.start;
+
/* Check if the buffer is empty. */
if (emitter->buffer.start == emitter->buffer.last) {