diff options
author | Guy Harris <guy@alum.mit.edu> | 2010-07-02 03:50:30 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2010-07-02 03:50:30 +0000 |
commit | 63a08108741aa3eb91cde3bf2cfffdaab81fe798 (patch) | |
tree | 198a2812ea7ec8b8040ad7603e0607c56a14bf81 /asn1 | |
parent | 89015cb5840fec071949d6ffa63b9dad4a0b06ab (diff) |
oid_encoded2string() returns a const char *; don't assign it to a char
*.
Don't declare variables in the middle of a block; not all the compilers
we use support that.
svn path=/trunk/; revision=33409
Diffstat (limited to 'asn1')
-rw-r--r-- | asn1/snmp/packet-snmp-template.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/asn1/snmp/packet-snmp-template.c b/asn1/snmp/packet-snmp-template.c index 8193fc537b..f423a14b0c 100644 --- a/asn1/snmp/packet-snmp-template.c +++ b/asn1/snmp/packet-snmp-template.c @@ -395,7 +395,7 @@ extern int dissect_snmp_VarBind(gboolean implicit_tag _U_, proto_item *pi_name, *pi_varbind, *pi_value = NULL; proto_tree *pt, *pt_varbind, *pt_name, *pt_value; char label[ITEM_LABEL_LENGTH]; - char* repr = NULL; + const char* repr = NULL; const char* info_oid = NULL; char* valstr; int hfid = -1; @@ -478,8 +478,10 @@ extern int dissect_snmp_VarBind(gboolean implicit_tag _U_, add_oid_debug_subtree(oid_info,pt_name); if (!subids) { + proto_item* pi; + repr = oid_encoded2string(oid_bytes, name_len); - proto_item* pi = proto_tree_add_text(pt_name,tvb, 0, 0, "invalid oid: %s", repr); + pi = proto_tree_add_text(pt_name,tvb, 0, 0, "invalid oid: %s", repr); pt = proto_item_add_subtree(pi, ett_decoding_error); expert_add_info_format(actx->pinfo, pi, PI_MALFORMED, PI_WARN, "invalid oid: %s", repr); return dissect_unknown_ber(actx->pinfo, tvb, name_offset, pt); |