summaryrefslogtreecommitdiffstats
path: root/epan/prefs.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--epan/prefs.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/epan/prefs.c b/epan/prefs.c
index 4625ec3d..0d3f0532 100644
--- a/epan/prefs.c
+++ b/epan/prefs.c
@@ -1705,7 +1705,11 @@ range_t* prefs_get_range_value_real(pref_t *pref, pref_source_t source)
range_t* prefs_get_range_value(const char *module_name, const char* pref_name)
{
- return prefs_get_range_value_real(prefs_find_preference(prefs_find_module(module_name), pref_name), pref_current);
+ pref_t *pref = prefs_find_preference(prefs_find_module(module_name), pref_name);
+ if (pref == NULL) {
+ return NULL;
+ }
+ return prefs_get_range_value_real(pref, pref_current);
}
void
@@ -2323,17 +2327,6 @@ pref_clean_stash(pref_t *pref, gpointer unused _U_)
return 0;
}
-#if 0
-/* Return the value assigned to the given uint preference. */
-guint
-prefs_get_uint_preference(pref_t *pref)
-{
- if (pref && pref->type == PREF_UINT)
- return *pref->varp.uint;
- return 0;
-}
-#endif
-
/*
* Call a callback function, with a specified argument, for each preference
* in a given module.
@@ -3369,9 +3362,13 @@ prefs_register_modules(void)
"The maximum number of items that can be added to the dissection tree (Increase with caution)",
10,
&prefs.gui_max_tree_items);
+ /*
+ * Used independently by proto_tree_add_node, call_dissector*, dissector_try_heuristic,
+ * and increment_dissection_depth.
+ */
prefs_register_uint_preference(gui_module, "max_tree_depth",
- "Maximum tree depth",
- "The maximum depth of the dissection tree (Increase with caution)",
+ "Maximum dissection depth",
+ "The maximum depth for dissection tree and protocol layer checks. (Increase with caution)",
10,
&prefs.gui_max_tree_depth);
@@ -4827,7 +4824,11 @@ guint prefs_get_uint_value_real(pref_t *pref, pref_source_t source)
guint prefs_get_uint_value(const char *module_name, const char* pref_name)
{
- return prefs_get_uint_value_real(prefs_find_preference(prefs_find_module(module_name), pref_name), pref_current);
+ pref_t *pref = prefs_find_preference(prefs_find_module(module_name), pref_name);
+ if (pref == NULL) {
+ return 0;
+ }
+ return prefs_get_uint_value_real(pref, pref_current);
}
char* prefs_get_password_value(pref_t *pref, pref_source_t source)