summaryrefslogtreecommitdiff
path: root/gtk/print_dlg.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2004-10-16 23:32:24 +0000
committerGuy Harris <guy@alum.mit.edu>2004-10-16 23:32:24 +0000
commit727ad67453a879a58ab46adeee058d2acbbe5c13 (patch)
tree9fe0f60bac0ddcee9a3c48d3ff0ca8003b3ca707 /gtk/print_dlg.c
parentde1bcd5d88f4ecd85df770ef5a7a0357b539ee4f (diff)
downloadwireshark-727ad67453a879a58ab46adeee058d2acbbe5c13.tar.gz
Remove the fixed maximum number of subranges in a range_t; dynamically
allocate them to be large enough. Add checks that the numbers in the range fit in a guint32. Check the validity of a range before saving or printing, and report errors in an alert box. Clean up white space. svn path=/trunk/; revision=12320
Diffstat (limited to 'gtk/print_dlg.c')
-rw-r--r--gtk/print_dlg.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gtk/print_dlg.c b/gtk/print_dlg.c
index 938c236e26..1dd30a5b36 100644
--- a/gtk/print_dlg.c
+++ b/gtk/print_dlg.c
@@ -748,6 +748,14 @@ print_ok_cb(GtkWidget *ok_bt, gpointer parent_w)
args = (print_args_t *)OBJECT_GET_DATA(ok_bt, PRINT_ARGS_KEY);
+ /* Check whether the range is valid. */
+ if (!range_check_validity(&args->range)) {
+ /* The range isn't valid; don't dismiss the print/export dialog box,
+ just leave it around so that the user can, after they
+ dismiss the alert box popped up for the error, try again. */
+ return;
+ }
+
button = (GtkWidget *)OBJECT_GET_DATA(ok_bt, PRINT_DEST_CB_KEY);
args->to_file = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (button));