diff options
author | Guy Harris <gharris@sonic.net> | 2021-03-20 01:33:44 -0700 |
---|---|---|
committer | Guy Harris <gharris@sonic.net> | 2021-03-20 01:33:44 -0700 |
commit | be000686de08f890191887968a5c1b36004f5808 (patch) | |
tree | 4f5296e135ed9483a00a35cb3568c0314a91ca71 /epan/prefs.c | |
parent | 9f04392c0f2249ae21c51132eacd6a1c58e09f30 (diff) |
prefs: use g_error() to report certan errors.
Other errors use g_error(); use it for these errors, so the message is
more meaningful.
Diffstat (limited to 'epan/prefs.c')
-rw-r--r-- | epan/prefs.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/epan/prefs.c b/epan/prefs.c index 0e37eedb33..c9757fd972 100644 --- a/epan/prefs.c +++ b/epan/prefs.c @@ -519,7 +519,8 @@ prefs_register_module_or_subtree(module_t *parent, const char *name, * protocol preferences to have a bogus "protocol.", or * something such as that, to be added to all their names). */ - g_assert(prefs_find_module(name) == NULL); + if (prefs_find_module(name) != NULL) + g_error("Preference module \"%s\" is being registered twice", name); /* * Insert this module in the list of all modules. @@ -530,7 +531,8 @@ prefs_register_module_or_subtree(module_t *parent, const char *name, * This has no name, just a title; check to make sure it's a * subtree, and crash if it's not. */ - g_assert(is_subtree); + if (!is_subtree) + g_error("Preferences module with no name is being registered at the top level"); } /* @@ -588,7 +590,8 @@ prefs_register_module_alias(const char *name, module_t *module) * * We search the list of all aliases. */ - g_assert(prefs_find_module_alias(name) == NULL); + if (prefs_find_module_alias(name) != NULL) + g_error("Preference module alias \"%s\" is being registered twice", name); alias = wmem_new(wmem_epan_scope(), module_alias_t); alias->name = name; |