aboutsummaryrefslogtreecommitdiffstats
path: root/packet-postgresql.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2004-02-18 07:27:46 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2004-02-18 07:27:46 +0000
commit33187f439bc64e9e55590431b84a1967d83984c5 (patch)
treec0489d84e39264206a04f99713cdea99c97e8429 /packet-postgresql.c
parentff18ce1449f1517cd2b3c4698c4ef45b72e288d6 (diff)
Use "tvb_get_string()" to get counted strings.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10090 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-postgresql.c')
-rw-r--r--packet-postgresql.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/packet-postgresql.c b/packet-postgresql.c
index f3ba73eb4a..b73a913656 100644
--- a/packet-postgresql.c
+++ b/packet-postgresql.c
@@ -3,7 +3,7 @@
*
* Copyright 2004, Edwin Calo <calo@fusemail.com>
*
- * $Id: packet-postgresql.c,v 1.2 2004/02/17 10:03:47 jmayer Exp $
+ * $Id: packet-postgresql.c,v 1.3 2004/02/18 07:27:46 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -94,9 +94,7 @@ dissect_postgresql (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
offset -= counter;
/* Reading the string from the packet */
- string = g_malloc( counter+1 );
- tvb_memcpy(tvb,string,offset,counter);
- string[counter]='\0'; /* Forcing end of string */
+ string = tvb_get_string(tvb,offset,counter);
/* Printing the data */
proto_tree_add_string (tree,hf_postgresql_string,tvb, offset,counter, string );
if (check_col (pinfo->cinfo, COL_INFO)) { col_append_fstr (pinfo->cinfo, COL_INFO, " %s", string ); }
@@ -129,9 +127,7 @@ dissect_postgresql (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
if( counter > 1)
{
/* Reading the string from the packet */
- string = g_malloc( counter+1 );
- tvb_memcpy(tvb,string,offset,counter);
- string[counter]='\0'; /* Forcing end of string */
+ string = tvb_get_string(tvb,offset,counter);
/* Printing the data */
proto_tree_add_string (tree,hf_postgresql_string,tvb, offset,counter, string );
if (check_col (pinfo->cinfo, COL_INFO)) { col_append_fstr (pinfo->cinfo, COL_INFO, " %s", string ); }