From 10552e31693981ab80ebe8ef9d0fa5c2bf55403f Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sun, 25 Jan 2004 01:58:58 +0000 Subject: Check whether the "fopen()" that creates a CSV file fails and, if so, report the error and don't dismiss the file selection dialog box. svn path=/trunk/; revision=9831 --- gtk/rtp_analysis.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gtk/rtp_analysis.c') diff --git a/gtk/rtp_analysis.c b/gtk/rtp_analysis.c index 1ace5039d0..9e0e0bdf92 100644 --- a/gtk/rtp_analysis.c +++ b/gtk/rtp_analysis.c @@ -1,7 +1,7 @@ /* rtp_analysis.c * RTP analysis addition for ethereal * - * $Id: rtp_analysis.c,v 1.24 2004/01/24 01:15:24 guy Exp $ + * $Id: rtp_analysis.c,v 1.25 2004/01/25 01:58:58 guy Exp $ * * Copyright 2003, Alcatel Business Systems * By Lars Ruoff @@ -956,6 +956,11 @@ static void save_csv_as_ok_cb(GtkWidget *bt _U_, gpointer fs /*user_data_t *user if (GTK_TOGGLE_BUTTON(forw)->active || GTK_TOGGLE_BUTTON(both)->active) { fp = fopen(g_dest, "w"); + if (fp == NULL) { + simple_dialog(ESD_TYPE_CRIT, NULL, + file_open_error_message(errno, TRUE), g_dest); + return; + } if (GTK_TOGGLE_BUTTON(both)->active) { fprintf(fp, "Forward\n"); -- cgit v1.2.3