]> git.tdb.fi Git - ext/subsurface.git/commitdiff
Oops. I forgot to 'fclose()' the file after saving the xml
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 4 Sep 2011 16:50:31 +0000 (09:50 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 4 Sep 2011 16:50:31 +0000 (09:50 -0700)
It never actually triggered anything for me, but any buffered data might
be lost, especially if you force-exit the application after saving a
dive log.

This probably explains a corrupted (truncated) dive file report from
Nathan Samson.

Reported-by: Nathan Samson <https://github.com/nathansamson>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
save-xml.c

index 9e3640cad84d9cf99e92eabf6d6c1e5369d896d2..5c05723b71e1ebf5df39a0c9f977d6d0f6ccb6e5 100644 (file)
@@ -193,4 +193,5 @@ void save_dives(const char *filename)
        for (i = 0; i < dive_table.nr; i++)
                save_dive(f, get_dive(i));
        fprintf(f, "</dives>\n");
+       fclose(f);
 }