From 7b614b3b59867f8524630adcde94eacaeb0cfcd8 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Fri, 15 Oct 2021 15:51:32 +0100 Subject: [PATCH] Move to end of file on append, when on Windows. --- lib/misc_mosq.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/misc_mosq.c b/lib/misc_mosq.c index 1a9c7993..5004125a 100644 --- a/lib/misc_mosq.c +++ b/lib/misc_mosq.c @@ -116,6 +116,9 @@ FILE *mosquitto__fopen(const char *path, const char *mode, bool restrict_read) _close(fd); return NULL; } + if(mode[0] == 'a'){ + fseek(fptr, 0, SEEK_END); + } return fptr; }else {