aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/unistim
diff options
context:
space:
mode:
authorwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>2009-03-27 14:46:54 +0000
committerwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>2009-03-27 14:46:54 +0000
commitbf340f14fc7cf7495c8ee3e5bf67bb2750919714 (patch)
treecb40b4a9c856a74dbd6d3ee3f615b84afc6e1c9b /plugins/unistim
parent4ed29985aba06f5e6f25fa6693ffcdcecc5bb5d3 (diff)
Replace some unnecessary use of g_snprintf and g_strdup_printf
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@27864 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'plugins/unistim')
-rw-r--r--plugins/unistim/packet-unistim.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/plugins/unistim/packet-unistim.c b/plugins/unistim/packet-unistim.c
index 13e085136d..f2ecffb9c4 100644
--- a/plugins/unistim/packet-unistim.c
+++ b/plugins/unistim/packet-unistim.c
@@ -2611,9 +2611,7 @@ set_ascii_item(proto_tree *msg_tree,tvbuff_t *tvb, gint offset,guint msg_len){
#define MAX_BUFFER 1024
buffer=ep_alloc(MAX_BUFFER);
- g_snprintf(buffer,MAX_BUFFER,"%s",label);
- buffer_index=strlen(label);
-
+ buffer_index=g_strlcpy(buffer,label,MAX_BUFFER);
while((buffer_index<MAX_BUFFER-2)&&(msg_index<msg_len)){
character=tvb_get_guint8(tvb,offset+msg_index);
msg_index++;
@@ -2645,9 +2643,7 @@ set_ascii_null_term_item(proto_tree *msg_tree,tvbuff_t *tvb, gint offset,guint m
#define MAX_BUFFER 1024
buffer=ep_alloc(MAX_BUFFER);
- g_snprintf(buffer,MAX_BUFFER,"%s",label);
- buffer_index=strlen(label);
-
+ buffer_index=g_strlcpy(buffer,label,MAX_BUFFER);
while((buffer_index<MAX_BUFFER-2)&&(msg_index<msg_len)){
character=tvb_get_guint8(tvb,offset+msg_index);
msg_index++;