aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-snmp.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2010-07-02 03:50:30 +0000
committerGuy Harris <guy@alum.mit.edu>2010-07-02 03:50:30 +0000
commit63a08108741aa3eb91cde3bf2cfffdaab81fe798 (patch)
tree198a2812ea7ec8b8040ad7603e0607c56a14bf81 /epan/dissectors/packet-snmp.c
parent89015cb5840fec071949d6ffa63b9dad4a0b06ab (diff)
downloadwireshark-63a08108741aa3eb91cde3bf2cfffdaab81fe798.tar.gz
wireshark-63a08108741aa3eb91cde3bf2cfffdaab81fe798.tar.bz2
wireshark-63a08108741aa3eb91cde3bf2cfffdaab81fe798.zip
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 'epan/dissectors/packet-snmp.c')
-rw-r--r--epan/dissectors/packet-snmp.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/epan/dissectors/packet-snmp.c b/epan/dissectors/packet-snmp.c
index cafbba864f..24afce7185 100644
--- a/epan/dissectors/packet-snmp.c
+++ b/epan/dissectors/packet-snmp.c
@@ -497,7 +497,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;
@@ -580,8 +580,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);
@@ -2698,7 +2700,7 @@ static void dissect_SMUX_PDUs_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, pro
/*--- End of included file: packet-snmp-fn.c ---*/
-#line 1478 "packet-snmp-template.c"
+#line 1480 "packet-snmp-template.c"
guint
@@ -3553,7 +3555,7 @@ void proto_register_snmp(void) {
NULL, HFILL }},
/*--- End of included file: packet-snmp-hfarr.c ---*/
-#line 2068 "packet-snmp-template.c"
+#line 2070 "packet-snmp-template.c"
};
/* List of subtrees */
@@ -3593,7 +3595,7 @@ void proto_register_snmp(void) {
&ett_snmp_RReqPDU_U,
/*--- End of included file: packet-snmp-ettarr.c ---*/
-#line 2084 "packet-snmp-template.c"
+#line 2086 "packet-snmp-template.c"
};
module_t *snmp_module;