diff options
author | Guy Harris <guy@alum.mit.edu> | 2015-02-17 16:40:28 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2015-02-18 00:41:09 +0000 |
commit | 859511db14feae071cc1e6e1889ae39bfd276faa (patch) | |
tree | a6ef5501110220c93d583439f5f0257c243cde64 /epan/dissectors/packet-zbee-security.c | |
parent | 3f765b3ef94fd6044279d47d0b30b46c344e5943 (diff) | |
download | wireshark-859511db14feae071cc1e6e1889ae39bfd276faa.tar.gz |
Make UAT record update callbacks return a success/failure indication.
Have them return TRUE on success and FALSE on failure. Check the return
value rather than whether the error string pointer is null or not.
Change-Id: I800a03bcd70a6bbb7b217cf7c4800e9cdcf2189c
Reviewed-on: https://code.wireshark.org/review/7222
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/dissectors/packet-zbee-security.c')
-rw-r--r-- | epan/dissectors/packet-zbee-security.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/epan/dissectors/packet-zbee-security.c b/epan/dissectors/packet-zbee-security.c index c2312a1b1f..51590f01ed 100644 --- a/epan/dissectors/packet-zbee-security.c +++ b/epan/dissectors/packet-zbee-security.c @@ -159,12 +159,13 @@ static void* uat_key_record_copy_cb(void* n, const void* o, size_t siz _U_) { return new_key; } -static void uat_key_record_update_cb(void* r, char** err) { +static gboolean uat_key_record_update_cb(void* r, char** err) { uat_key_record_t* rec = (uat_key_record_t *)r; guint8 key[ZBEE_SEC_CONST_KEYSIZE]; if (rec->string == NULL) { *err = g_strdup("Key can't be blank"); + return FALSE; } else { g_strstrip(rec->string); @@ -173,11 +174,14 @@ static void uat_key_record_update_cb(void* r, char** err) { if ( !zbee_security_parse_key(rec->string, key, rec->byte_order) ) { *err = g_strdup_printf("Expecting %d hexadecimal bytes or\n" "a %d character double-quoted string", ZBEE_SEC_CONST_KEYSIZE, ZBEE_SEC_CONST_KEYSIZE); + return FALSE; } } else { *err = g_strdup("Key can't be blank"); + return FALSE; } } + return TRUE; } static void uat_key_record_free_cb(void*r) { |