aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/unistim
diff options
context:
space:
mode:
authorBill Meier <wmeier@newsguy.com>2009-03-27 14:46:54 +0000
committerBill Meier <wmeier@newsguy.com>2009-03-27 14:46:54 +0000
commita0eee8c29970dff3cd5b1d27a06bc07d1d47236e (patch)
treecb40b4a9c856a74dbd6d3ee3f615b84afc6e1c9b /plugins/unistim
parente284ca63d5e1e96bc588833c251a5d2bfed763c3 (diff)
Replace some unnecessary use of g_snprintf and g_strdup_printf
svn path=/trunk/; revision=27864
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++;