If we don't want to dump core when a field is registered twice, at least

make the message give enough information to give us some hope of finding
the offending field.

svn path=/trunk/; revision=16179
This commit is contained in:
Guy Harris 2005-10-10 18:06:50 +00:00
parent ad3db4ffa2
commit ef966c3377
1 changed files with 6 additions and 1 deletions

View File

@ -2920,7 +2920,12 @@ proto_register_field_array(int parent, hf_register_info *hf, int num_records)
* 0 (which is unlikely to be the field ID we get back
* from "proto_register_field_init()").
*/
DISSECTOR_ASSERT((*ptr->p_id == -1 || *ptr->p_id == 0) && "Duplicate field detected in call to proto_register_field_array");
if (*ptr->p_id != -1 && *ptr->p_id != 0) {
fprintf(stderr,
"Duplicate field detected in call to proto_register_field_array: %s is already registered\n",
hf->hfinfo.abbrev);
return;
}
if (proto != NULL) {
if (proto->fields == NULL) {