diff options
author | Guy Harris <guy@alum.mit.edu> | 2005-01-16 23:30:55 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2005-01-16 23:30:55 +0000 |
commit | 2bdef3c1229d5c492c0e574135b3ef4589647b2a (patch) | |
tree | 598e354d8cb4cd7006ea802dd45aa74e027b5454 /epan/proto.c | |
parent | 13bf5539af20a4c372bbcb58c0a0f8d051ab3dbc (diff) |
Rename the FieldError exception to DissectorError.
Add a DISSECTOR_ASSERT() macro, which is the usual type of assertion
macro, but throws a DissectorError exception with a message giving the
flien and line number and the failed test as a string. Use that macro
in "alloc_field_info()".
Report that exception in the Info column and the protocol tree, as well
as logging the exception failure with g_warning().
svn path=/trunk/; revision=13078
Diffstat (limited to 'epan/proto.c')
-rw-r--r-- | epan/proto.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/epan/proto.c b/epan/proto.c index 100e7dd138..bcc3a877ef 100644 --- a/epan/proto.c +++ b/epan/proto.c @@ -2002,7 +2002,6 @@ alloc_field_info(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, { header_field_info *hfinfo; field_info *fi; - gchar *error_descr; /* * We only allow a null tvbuff if the item has a zero length, @@ -2093,11 +2092,7 @@ alloc_field_info(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, g_assert_not_reached(); } } else - if(*length < 0) { - error_descr = g_strdup_printf("\"%s\" - \"%s\" invalid length: %d %s/%u", - hfinfo->name, hfinfo->abbrev, *length, __FILE__, __LINE__); - THROW_MESSAGE(FieldError, error_descr); - } + DISSECTOR_ASSERT(*length >= 0); FIELD_INFO_NEW(fi); |