[dia] [warningectomy] missing error handling in export_vdx()
- From: Hans Breuer <hans src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia] [warningectomy] missing error handling in export_vdx()
- Date: Sat, 4 May 2013 19:01:26 +0000 (UTC)
commit 3adb23ac2653bcaa6c7e3335b2d203d8e2881f64
Author: Hans Breuer <hans breuer org>
Date: Sat May 4 19:45:00 2013 +0200
[warningectomy] missing error handling in export_vdx()
vdx-export.c: In function 'export_vdx':
vdx-export.c:1857:1: warning: control reaches end of non-void function
now the error is registered in the context and FALSE is returned.
plug-ins/vdx/vdx-export.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/plug-ins/vdx/vdx-export.c b/plug-ins/vdx/vdx-export.c
index 36826d5..812a3ba 100644
--- a/plug-ins/vdx/vdx-export.c
+++ b/plug-ins/vdx/vdx-export.c
@@ -1853,7 +1853,12 @@ export_vdx(DiagramData *data, DiaContext *ctx,
/* dont screw Dia's global state */
setlocale(LC_NUMERIC, old_locale);
- fclose(file);
+ if (fclose(file) != 0) {
+ dia_context_add_message_with_errno (ctx, errno, _("Saving file '%s' failed."),
+ dia_context_get_filename(ctx));
+ return FALSE;
+ }
+ return TRUE;
}
/* interface from filter.h */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]