diff options
author | Guy Harris <guy@alum.mit.edu> | 2005-12-04 04:22:43 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2005-12-04 04:22:43 +0000 |
commit | 46325167d9f51ebecf7c4ab2e304d553e6971afa (patch) | |
tree | 2957596b00d6911b2290e494bba19795eaf3f33b /epan | |
parent | 2e6b1ac3b392528799716f803f488f99cde9d49e (diff) |
Check for a null blurb pointer for a field, as is done in some other
locations, and initialize the blurb field to NULL for protocols, now
that we support the blurb being a null pointer.
svn path=/trunk/; revision=16672
Diffstat (limited to 'epan')
-rw-r--r-- | epan/proto.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/epan/proto.c b/epan/proto.c index 9f588a1819..10d743320c 100644 --- a/epan/proto.c +++ b/epan/proto.c @@ -2967,7 +2967,7 @@ proto_register_protocol(const char *name, const char *short_name, const char *fi hfinfo->bitmask = 0; hfinfo->bitshift = 0; hfinfo->ref_count = 0; - hfinfo->blurb = ""; + hfinfo->blurb = NULL; hfinfo->parent = -1; /* this field differentiates protos and fields */ proto_id = proto_register_field_init(hfinfo, hfinfo->parent); @@ -4496,6 +4496,7 @@ proto_registrar_dump_fields(int format) int i, len; const char *enum_name; const char *base_name; + const char *blurb; len = gpa_hfinfo.len; for (i = 0; i < len ; i++) { @@ -4507,7 +4508,6 @@ proto_registrar_dump_fields(int format) * a field, and we don't want it in the list of filterable * fields. * - * * XXX - perhaps the name and abbrev field should be null * pointers rather than null strings for that pseudo-field, * but we'd have to add checks for null pointers in some @@ -4586,20 +4586,24 @@ proto_registrar_dump_fields(int format) } } + blurb = hfinfo->blurb; + if (blurb == NULL) + blurb = ""; if (format == 1) { - printf("F\t%s\t%s\t%s\t%s\t%s\n", hfinfo->name, hfinfo->abbrev, - enum_name,parent_hfinfo->abbrev, hfinfo->blurb); + printf("F\t%s\t%s\t%s\t%s\t%s\n", + hfinfo->name, hfinfo->abbrev, enum_name, + parent_hfinfo->abbrev, blurb); } else if (format == 2) { printf("F\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n", - hfinfo->name, hfinfo->abbrev, - enum_name,parent_hfinfo->abbrev, hfinfo->blurb, - base_name, hfinfo->blurb); + hfinfo->name, hfinfo->abbrev, enum_name, + parent_hfinfo->abbrev, blurb, + base_name, blurb); } else if (format == 3) { printf("F\t%s\t%s\t%s\t%s\t%s\t%s\t%u\n", - hfinfo->name, hfinfo->abbrev, - enum_name,parent_hfinfo->abbrev, hfinfo->blurb, + hfinfo->name, hfinfo->abbrev, enum_name, + parent_hfinfo->abbrev, blurb, base_name, hfinfo->bitmask); } else { |