diff --git a/epan/prefs-int.h b/epan/prefs-int.h index 7d3d28fd9c..3769dce666 100644 --- a/epan/prefs-int.h +++ b/epan/prefs-int.h @@ -42,7 +42,7 @@ struct pref_module { }; /* - * Module used for protocol preferences. + * Module used for protocol preferences. * With MSVC and a libwireshark.dll, we need a special declaration. */ WS_VAR_IMPORT module_t *protocols_module; @@ -97,10 +97,6 @@ struct preference { void *control; /* handle for GUI control for this preference */ }; -gint find_val_for_string(const char *needle, const enum_val_t *haystack, - gint default_value); - - /* read_prefs_file: read in a generic config file and do a callback to */ /* pref_set_pair_fct() for every key/value pair found */ typedef prefs_set_pref_e (*pref_set_pair_cb) (gchar *key, gchar *value, void *private_data); 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;