aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/mgcp_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/mgcp_stat.c
parent00eb774c394449123f8faed955d87a09e669dba9 (diff)
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/mgcp_stat.c')
-rw-r--r--gtk/mgcp_stat.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/gtk/mgcp_stat.c b/gtk/mgcp_stat.c
index 0f05fe7841..e3833c4749 100644
--- a/gtk/mgcp_stat.c
+++ b/gtk/mgcp_stat.c
@@ -2,7 +2,7 @@
* mgcp-statistics for ethereal
* Copyright 2003 Lars Roland
*
- * $Id: mgcp_stat.c,v 1.9 2003/09/02 08:27:38 sahlberg Exp $
+ * $Id: mgcp_stat.c,v 1.10 2003/09/15 19:05:00 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -110,7 +110,12 @@ mgcpstat_reset(void *pms)
ms->req_dup_num=0;
ms->rsp_dup_num=0;
- snprintf(title, 255, "MGCP SRT Statistics: %s", get_basename(cfile.filename));
+ if (cfile.filename)
+ snprintf(title, 255, "MGCP SRT Statistics: %s", get_basename(cfile.filename));
+ else
+ snprintf(title, 255, "MGCP SRT Statistics");
+ if (! dlg)
+ dlg=gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(dlg), title);
}
@@ -345,7 +350,10 @@ gtk_mgcpstat_cb(GtkWidget *w _U_, gpointer d _U_)
}
dlg=gtk_window_new(GTK_WINDOW_TOPLEVEL);
- snprintf(title, 255, "MGCP SRT Statistics: %s", get_basename(cfile.filename));
+ if (cfile.filename)
+ snprintf(title, 255, "MGCP SRT Statistics: %s", get_basename(cfile.filename));
+ else
+ snprintf(title, 255, "MGCP SRT Statistics");
gtk_window_set_title(GTK_WINDOW(dlg), title);
SIGNAL_CONNECT(dlg, "destroy", dlg_destroy_cb, NULL);
dlg_box=gtk_vbox_new(FALSE, 0);