diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2004-06-29 05:47:20 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2004-06-29 05:47:20 +0000 |
commit | 394fcfe41c69937350efee6f85ff64a1094ef0a2 (patch) | |
tree | 99b999af2f3f6effa2d84587f27f531bb1c2d35c /prefs.c | |
parent | c428f54a583823bea44621127854c1b2c3f1948d (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.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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); |