aboutsummaryrefslogtreecommitdiffstats
path: root/prefs.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2004-06-29 05:47:20 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2004-06-29 05:47:20 +0000
commit394fcfe41c69937350efee6f85ff64a1094ef0a2 (patch)
tree99b999af2f3f6effa2d84587f27f531bb1c2d35c /prefs.c
parentc428f54a583823bea44621127854c1b2c3f1948d (diff)
Catch invalid GUI layout type values; if we see one, use the default
layout type. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11264 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'prefs.c')
-rw-r--r--prefs.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/prefs.c b/prefs.c
index 5223506d56..f036541a77 100644
--- a/prefs.c
+++ b/prefs.c
@@ -1,7 +1,7 @@
/* prefs.c
* Routines for handling preferences
*
- * $Id: prefs.c,v 1.137 2004/06/20 15:57:07 ulfl Exp $
+ * $Id: prefs.c,v 1.138 2004/06/29 05:47:20 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -1649,7 +1649,12 @@ set_pref(gchar *pref_name, gchar *value)
}
} else if (strcmp(pref_name, PRS_GUI_LAYOUT_TYPE) == 0) {
prefs.gui_layout_type = strtoul(value, NULL, 10);
-
+ if (prefs.gui_layout_type == layout_unused ||
+ prefs.gui_layout_type >= layout_type_max) {
+ /* XXX - report an error? It's not a syntax error - we'd need to
+ add a way of reporting a *semantic* error. */
+ prefs.gui_layout_type = layout_type_5;
+ }
} else if (strcmp(pref_name, PRS_GUI_LAYOUT_CONTENT_1) == 0) {
prefs.gui_layout_content_1 =
find_index_from_string_array(value, gui_layout_content_text, 0);