diff options
author | Guy Harris <guy@alum.mit.edu> | 2004-02-25 23:13:55 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2004-02-25 23:13:55 +0000 |
commit | 25ebe4f252aef249e78f9710c646872c7c8469d7 (patch) | |
tree | 566ed24c9cbc3126d40b79cf5d011c542e86082b /packet-sna.c | |
parent | 455868722023c11d65ff2ad785a8f40cd4b2edec (diff) | |
download | wireshark-25ebe4f252aef249e78f9710c646872c7c8469d7.tar.gz wireshark-25ebe4f252aef249e78f9710c646872c7c8469d7.tar.bz2 wireshark-25ebe4f252aef249e78f9710c646872c7c8469d7.zip |
Use "tvb_get_string()" rather than duplicating its functionality by
hand.
In "dissect_control_0e()", use the remaining reported length in the
tvbuff rather than the length.
svn path=/trunk/; revision=10242
Diffstat (limited to 'packet-sna.c')
-rw-r--r-- | packet-sna.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/packet-sna.c b/packet-sna.c index 95a8bdcfcf..69d95c2035 100644 --- a/packet-sna.c +++ b/packet-sna.c @@ -3,7 +3,7 @@ * Gilbert Ramirez <gram@alumni.rice.edu> * Jochen Friedrich <jochen@scram.de> * - * $Id: packet-sna.c,v 1.49 2003/12/21 05:51:34 jmayer Exp $ + * $Id: packet-sna.c,v 1.50 2004/02/25 23:13:55 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -2414,7 +2414,7 @@ dissect_control_05(tvbuff_t *tvb, proto_tree *tree) static void dissect_control_0e(tvbuff_t *tvb, proto_tree *tree) { - guint len; + gint len; guint8 *buf; if (!tree) @@ -2422,14 +2422,12 @@ dissect_control_0e(tvbuff_t *tvb, proto_tree *tree) proto_tree_add_item(tree, hf_sna_control_0e_type, tvb, 2, 1, FALSE); - len = tvb_length(tvb) - 3; + len = tvb_reported_length_remaining(tvb, 3); if (len <= 0) return; - buf = g_malloc(len+1); - tvb_memcpy (tvb, buf, 3, len); + buf = tvb_get_string(tvb, 3, len); EBCDIC_to_ASCII(buf, len); - buf[len] = 0; proto_tree_add_string(tree, hf_sna_control_0e_value, tvb, 3, len, buf); g_free(buf); } |