From f9a55387589e97aab892fdbf44e5b3e0419a78f8 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sat, 11 May 2024 11:56:26 +0100 Subject: [PATCH] writer: Move the cursor back to end when finished writing Signed-off-by: Michael Tremer --- src/writer.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/writer.c b/src/writer.c index 5ea992b..ec5f896 100644 --- a/src/writer.c +++ b/src/writer.c @@ -774,6 +774,11 @@ LOC_EXPORT int loc_writer_write(struct loc_writer* writer, FILE* f, enum loc_dat return r; } + // Seek back to the end + r = fseek(f, 0, SEEK_END); + if (r) + return r; + // Flush everything fflush(f); -- 2.39.5