aboutsummaryrefslogtreecommitdiffstats
path: root/epan/prefs.c
diff options
context:
space:
mode:
authormorriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7>2010-05-25 20:57:14 +0000
committermorriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7>2010-05-25 20:57:14 +0000
commit9d5598dcad9af9d6df6e1c7f19343b5af576c658 (patch)
treead30923c758fed86ac836606e83f0c9461484c51 /epan/prefs.c
parentb7d49d5a85fdf8f3b93b8b3111ecb78715123761 (diff)
find_val_for_string() is only used in prefs.c so remove the prototype
and make it static. When reading enum preferences, use the current value of the preference as the default value of the preference instead of a hard-coded 1. This way if we couldn't find the appropriate value we'll don't end up changing the preference to something that may or may not make sense. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32950 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/prefs.c')
-rw-r--r--epan/prefs.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/epan/prefs.c b/epan/prefs.c
index 7d81946ff6..5ac2a702d8 100644
--- a/epan/prefs.c
+++ b/epan/prefs.c
@@ -988,9 +988,9 @@ prefs_clear_string_list(GList *sl)
* Otherwise, the default value that was passed as the third argument is
* returned.
*/
-gint
+static gint
find_val_for_string(const char *needle, const enum_val_t *haystack,
- gint default_value)
+ gint default_value)
{
int i;
@@ -2551,8 +2551,8 @@ set_pref(gchar *pref_name, gchar *value, void *private_data _U_)
case PREF_ENUM:
/* XXX - give an error if it doesn't match? */
- enum_val = find_val_for_string(value,
- pref->info.enum_info.enumvals, 1);
+ enum_val = find_val_for_string(value, pref->info.enum_info.enumvals,
+ *pref->varp.enump);
if (*pref->varp.enump != enum_val) {
module->prefs_changed = TRUE;
*pref->varp.enump = enum_val;