aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-sctp.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-02-17 16:40:28 -0800
committerGuy Harris <guy@alum.mit.edu>2015-02-18 00:41:09 +0000
commit859511db14feae071cc1e6e1889ae39bfd276faa (patch)
treea6ef5501110220c93d583439f5f0257c243cde64 /epan/dissectors/packet-sctp.c
parent3f765b3ef94fd6044279d47d0b30b46c344e5943 (diff)
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-sctp.c')
-rw-r--r--epan/dissectors/packet-sctp.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/epan/dissectors/packet-sctp.c b/epan/dissectors/packet-sctp.c
index 48962aa045..e35dcbf144 100644
--- a/epan/dissectors/packet-sctp.c
+++ b/epan/dissectors/packet-sctp.c
@@ -538,20 +538,20 @@ sctp_chunk_type_free_cb(void* r)
if (rec->type_name) g_free(rec->type_name);
}
-static void
+static gboolean
sctp_chunk_type_update_cb(void *r, char **err)
{
type_field_t *rec = (type_field_t *)r;
char c;
if (rec->type_name == NULL) {
*err = g_strdup("Header name can't be empty");
- return;
+ return FALSE;
}
g_strstrip(rec->type_name);
if (rec->type_name[0] == 0) {
*err = g_strdup("Header name can't be empty");
- return;
+ return FALSE;
}
/* Check for invalid characters (to avoid asserting out when
@@ -560,10 +560,11 @@ sctp_chunk_type_update_cb(void *r, char **err)
c = proto_check_field_name(rec->type_name);
if (c) {
*err = g_strdup_printf("Header name can't contain '%c'", c);
- return;
+ return FALSE;
}
*err = NULL;
+ return TRUE;
}
static struct _sctp_info sctp_info;