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 {