aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/fc_stat.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2003-09-15 19:05:01 +0000
committerGuy Harris <guy@alum.mit.edu>2003-09-15 19:05:01 +0000
commit7bfaf8caf32f39186583f9e8b556580b2e121a00 (patch)
tree4701f97d4665b1e5094ca191bd75a2710f4d1259 /gtk/fc_stat.c
parent00eb774c394449123f8faed955d87a09e669dba9 (diff)
downloadwireshark-7bfaf8caf32f39186583f9e8b556580b2e121a00.tar.gz
wireshark-7bfaf8caf32f39186583f9e8b556580b2e121a00.tar.bz2
wireshark-7bfaf8caf32f39186583f9e8b556580b2e121a00.zip
From Graeme Hewson:
Don't crash if "-z" is used on the command line when a live capture is being done (e.g., with "-k -S" - in that case, "cfile.filename" is null when the window is created), just don't display the file name in the title. Don't set the title of a non-existent window - create the window first. svn path=/trunk/; revision=8472
Diffstat (limited to 'gtk/fc_stat.c')
-rw-r--r--gtk/fc_stat.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gtk/fc_stat.c b/gtk/fc_stat.c
index 549d5038f6..980a6e830e 100644
--- a/gtk/fc_stat.c
+++ b/gtk/fc_stat.c
@@ -1,7 +1,7 @@
/* fc_stat.c
* fc_stat 2003 Ronnie Sahlberg
*
- * $Id: fc_stat.c,v 1.5 2003/09/05 10:26:44 sahlberg Exp $
+ * $Id: fc_stat.c,v 1.6 2003/09/15 19:05:00 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -65,7 +65,10 @@ fcstat_reset(void *pfc)
char title[256];
reset_srt_table_data(&fc->fc_srt_table);
- snprintf(title, 255, "Fibre Channel Service Response Time statistics : %s", get_basename(cfile.filename));
+ if (cfile.filename)
+ snprintf(title, 255, "Fibre Channel Service Response Time statistics : %s", get_basename(cfile.filename));
+ else
+ snprintf(title, 255, "Fibre Channel Service Response Time statistics");
gtk_window_set_title(GTK_WINDOW(fc->win), title);
}
@@ -138,7 +141,10 @@ gtk_fcstat_init(char *optarg)
fc->win=gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_default_size(GTK_WINDOW(fc->win), 550, 400);
- snprintf(title, 255, "Fibre Channel Service Response Time statistics : %s", get_basename(cfile.filename));
+ if (cfile.filename)
+ snprintf(title, 255, "Fibre Channel Service Response Time statistics : %s", get_basename(cfile.filename));
+ else
+ snprintf(title, 255, "Fibre Channel Service Response Time statistics");
gtk_window_set_title(GTK_WINDOW(fc->win), title);
SIGNAL_CONNECT(fc->win, "destroy", win_destroy_cb, fc);