From: Linus Torvalds Date: Sun, 4 Sep 2011 16:50:31 +0000 (-0700) Subject: Oops. I forgot to 'fclose()' the file after saving the xml X-Git-Url: http://git.tdb.fi/?p=ext%2Fsubsurface.git;a=commitdiff_plain;h=a57668127eb0e00bc467ae0fc487592e95c17227 Oops. I forgot to 'fclose()' the file after saving the xml 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 Signed-off-by: Linus Torvalds --- diff --git a/save-xml.c b/save-xml.c index 9e3640c..5c05723 100644 --- a/save-xml.c +++ b/save-xml.c @@ -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, "\n"); + fclose(f); }