From ef966c3377ebcb6f0f15924a740e2c3653d1089d Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Mon, 10 Oct 2005 18:06:50 +0000 Subject: [PATCH] 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 --- epan/proto.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/epan/proto.c b/epan/proto.c index 3ed1e0afc3..5e66c4beca 100644 --- a/epan/proto.c +++ b/epan/proto.c @@ -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) {