diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2008-03-01 17:23:39 +0000 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2008-03-01 17:23:39 +0000 |
commit | b091b8d26cf290d1f4fdf41820f01e87bb6b7d6d (patch) | |
tree | 75b52bc6b03f8df488b8acbe97063df9d6d8b02d /epan/dissectors/packet-mgcp.c | |
parent | 346d46b8d020d0b5bdd9757622cdec2625349a10 (diff) |
Rewrote to use g_strlcpy and g_strlcat.
svn path=/trunk/; revision=24525
Diffstat (limited to 'epan/dissectors/packet-mgcp.c')
-rw-r--r-- | epan/dissectors/packet-mgcp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/epan/dissectors/packet-mgcp.c b/epan/dissectors/packet-mgcp.c index 445c5524e0..1a6539cec8 100644 --- a/epan/dissectors/packet-mgcp.c +++ b/epan/dissectors/packet-mgcp.c @@ -45,6 +45,7 @@ #include <epan/prefs.h> #include <epan/conversation.h> #include <epan/tap.h> +#include <epan/strutil.h> #include "packet-mgcp.h" #ifdef NEED_G_ASCII_STRCASECMP_H @@ -1451,8 +1452,7 @@ static void dissect_mgcp_firstline(tvbuff_t *tvb, packet_info *pinfo, proto_tree if (tokenlen > 4) THROW(ReportedBoundsError); code = tvb_format_text(tvb,tvb_previous_offset,tokenlen); - strncpy(mi->code,code,4); - mi->code[4] = '\0'; + g_strlcpy(mi->code,code,5); if (is_mgcp_verb(tvb,tvb_previous_offset,tvb_current_len,&verb_description)) { mgcp_type = MGCP_REQUEST; @@ -1597,7 +1597,7 @@ static void dissect_mgcp_firstline(tvbuff_t *tvb, packet_info *pinfo, proto_tree mi->request_available = TRUE; mgcp_call->responded = TRUE; mi->req_num = mgcp_call->req_num; - strncpy(mi->code,mgcp_call->code,5); + g_strlcpy(mi->code,mgcp_call->code,5); item = proto_tree_add_uint_format(tree, hf_mgcp_req_frame, tvb, 0, 0, mgcp_call->req_num, "This is a response to a request in frame %u", @@ -1751,7 +1751,7 @@ static void dissect_mgcp_firstline(tvbuff_t *tvb, packet_info *pinfo, proto_tree mgcp_call->transid = mi->transid; mgcp_call->responded = FALSE; mgcp_call->req_time=pinfo->fd->abs_ts; - strncpy(mgcp_call->code,mi->code,5); + g_strlcpy(mgcp_call->code,mi->code,5); /* Store it */ g_hash_table_insert(mgcp_calls, new_mgcp_call_key, mgcp_call); |