aboutsummaryrefslogtreecommitdiffstats
path: root/epan/uat.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-01-13 13:00:59 -0800
committerGuy Harris <guy@alum.mit.edu>2015-01-13 21:01:28 +0000
commit9f5e4fb7a51741a286ce5bc92a6f335ed58587a2 (patch)
tree3e2a2634f036dc891270ee59f488b5a66386d285 /epan/uat.c
parent25f010b2696ccccab44545971f43784946b23ba8 (diff)
uat_load() and uat_save() return a success indication; use it.
Instead of always ignoring the return value, always check it, and only report an error if it returns FALSE. (Alternative: have it return NULL on success and a pointer to a g_malloc()ed string on failure.) Fix a comment while we're at it. Change-Id: Icb72c9f47775b6552e3eb4fe5ddcc85482bfb5fb Reviewed-on: https://code.wireshark.org/review/6528 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/uat.c')
-rw-r--r--epan/uat.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/epan/uat.c b/epan/uat.c
index 3194e8c852..ceafea8826 100644
--- a/epan/uat.c
+++ b/epan/uat.c
@@ -434,14 +434,13 @@ void uat_load_all(void) {
for (i=0; i < all_uats->len; i++) {
uat_t* u = (uat_t *)g_ptr_array_index(all_uats,i);
- err = NULL;
- if (!u->loaded)
- uat_load(u, &err);
-
- if (err) {
- report_failure("Error loading table '%s': %s",u->name,err);
- g_free(err);
+ if (!u->loaded) {
+ err = NULL;
+ if (!uat_load(u, &err)) {
+ report_failure("Error loading table '%s': %s",u->name,err);
+ g_free(err);
+ }
}
}
}