diff options
author | Guy Harris <guy@alum.mit.edu> | 2015-01-13 13:00:59 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2015-01-13 21:01:28 +0000 |
commit | 9f5e4fb7a51741a286ce5bc92a6f335ed58587a2 (patch) | |
tree | 3e2a2634f036dc891270ee59f488b5a66386d285 /caputils/airpcap_loader.c | |
parent | 25f010b2696ccccab44545971f43784946b23ba8 (diff) | |
download | wireshark-9f5e4fb7a51741a286ce5bc92a6f335ed58587a2.tar.gz wireshark-9f5e4fb7a51741a286ce5bc92a6f335ed58587a2.tar.bz2 wireshark-9f5e4fb7a51741a286ce5bc92a6f335ed58587a2.zip |
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 'caputils/airpcap_loader.c')
-rw-r--r-- | caputils/airpcap_loader.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/caputils/airpcap_loader.c b/caputils/airpcap_loader.c index 28a42167d8..6ac4b2a633 100644 --- a/caputils/airpcap_loader.c +++ b/caputils/airpcap_loader.c @@ -165,9 +165,9 @@ get_wep_key(pref_t *pref, gpointer ud) /* This is just a sanity check. UAT should be loaded */ if (!uat->loaded) { - uat_load(uat, &err); - if (err != NULL) + if (!uat_load(uat, &err)) { + /* XXX - report the error */ g_free(err); return 1; } @@ -265,9 +265,9 @@ set_wep_key(pref_t *pref, gpointer ud _U_) { /* UAT will only be loaded if previous keys exist, so it may need to be loaded now */ - uat_load(uat, &err); - if (err != NULL) + if (!uat_load(uat, &err)) { + /* XXX - report the error */ g_free(err); return 1; } @@ -285,9 +285,9 @@ set_wep_key(pref_t *pref, gpointer ud _U_) uat_add_record(uat, &uat_key, TRUE); } - uat_save(uat, &err); - if (err != NULL) + if (!uat_save(uat, &err)) { + /* XXX - report the error */ g_free(err); return 1; } |