add missing fflush() on close - fixes a bug in the lock/unlock order (thx, Cyrus)
[project/uci.git] / util.c
diff --git a/util.c b/util.c
index cb88968..9843058 100644 (file)
--- a/util.c
+++ b/util.c
@@ -478,6 +478,7 @@ static void uci_close_stream(FILE *stream)
        if (!stream)
                return;
 
+       fflush(stream);
        fd = fileno(stream);
        flock(fd, LOCK_UN);
        fclose(stream);