From 19cadf17dad77f44ff71cd41e6c276cdb848f9bd Mon Sep 17 00:00:00 2001 From: Dave Peticolas Date: Thu, 24 Jan 2002 06:34:49 +0000 Subject: [PATCH] Peter O'Gorman's file i/o patches. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6646 57a11ea4-9604-0410-9ed3-97b8803252fd --- AUTHORS | 1 + doc/sgml/C/xacc-about.sgml | 7 +++++++ src/backend/file/io-example-account.c | 4 ++++ src/backend/file/io-gncxml-v2.c | 9 +++++++-- 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index 84f595acb2..0584c6c999 100644 --- a/AUTHORS +++ b/AUTHORS @@ -155,6 +155,7 @@ Stefan Nobis German translation patch Martin Norbäck Swedish translation Peter Norton for a valiant attempt at a GTK port Bill Nottingham guile configure patch +Peter O'Gorman file i/o patches OmNiBuS web site graphics & content Gordon Oliver multiple currency status line patch Alan Orndorff Solaris packager diff --git a/doc/sgml/C/xacc-about.sgml b/doc/sgml/C/xacc-about.sgml index dc7767f9d9..cbb0104fbc 100644 --- a/doc/sgml/C/xacc-about.sgml +++ b/doc/sgml/C/xacc-about.sgml @@ -825,6 +825,13 @@ Nielsen + +peter@pogma.com Peter O'Gorman + +file i/o patches + + + webmaster@obsidian.uia.net OmNiBuS diff --git a/src/backend/file/io-example-account.c b/src/backend/file/io-example-account.c index 4046b31661..fefd0a6998 100644 --- a/src/backend/file/io-example-account.c +++ b/src/backend/file/io-example-account.c @@ -361,6 +361,10 @@ gnc_write_example_account(GncExampleAccount *gea, const gchar *filename) FILE *out; out = fopen(filename, "w"); + if (out == NULL) + { + return FALSE; + } fprintf(out, "\n"); fprintf(out, "<" GNC_ACCOUNT_STRING ">\n"); diff --git a/src/backend/file/io-gncxml-v2.c b/src/backend/file/io-gncxml-v2.c index 57f05e142d..bbd12102ec 100644 --- a/src/backend/file/io-gncxml-v2.c +++ b/src/backend/file/io-gncxml-v2.c @@ -950,15 +950,20 @@ gnc_book_write_to_xml_file_v2(GNCBook *book, const char *filename) FILE *out; out = fopen(filename, "w"); + if (out == NULL) + { + return FALSE; + } + gnc_book_write_to_xml_filehandle_v2 (book, out); write_emacs_trailer(out); - if(fclose(out) != 0) + if (fclose(out) != 0) { return FALSE; } - + return TRUE; }