diff options
author | Bill Meier <wmeier@newsguy.com> | 2009-03-27 14:46:54 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2009-03-27 14:46:54 +0000 |
commit | a0eee8c29970dff3cd5b1d27a06bc07d1d47236e (patch) | |
tree | cb40b4a9c856a74dbd6d3ee3f615b84afc6e1c9b /plugins | |
parent | e284ca63d5e1e96bc588833c251a5d2bfed763c3 (diff) |
Replace some unnecessary use of g_snprintf and g_strdup_printf
svn path=/trunk/; revision=27864
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mate/mate_setup.c | 8 | ||||
-rw-r--r-- | plugins/unistim/packet-unistim.c | 8 |
2 files changed, 6 insertions, 10 deletions
diff --git a/plugins/mate/mate_setup.c b/plugins/mate/mate_setup.c index 972f0304e5..bd6d150cae 100644 --- a/plugins/mate/mate_setup.c +++ b/plugins/mate/mate_setup.c @@ -223,7 +223,7 @@ static void new_attr_hfri(gchar* item_name, GHashTable* hfids, gchar* name) { memset(&hfri, 0, sizeof hfri); hfri.p_id = p_id; - hfri.hfinfo.name = g_strdup_printf("%s",name); + hfri.hfinfo.name = g_strdup(name); hfri.hfinfo.abbrev = g_strdup_printf("mate.%s.%s",item_name,name); hfri.hfinfo.type = FT_STRING; hfri.hfinfo.display = BASE_NONE; @@ -275,7 +275,7 @@ static void analyze_pdu_config(mate_cfg_pdu* cfg) { gint* ett; hfri.p_id = &(cfg->hfid); - hfri.hfinfo.name = g_strdup_printf("%s",cfg->name); + hfri.hfinfo.name = g_strdup(cfg->name); hfri.hfinfo.abbrev = g_strdup_printf("mate.%s",cfg->name); hfri.hfinfo.blurb = g_strdup_printf("%s id",cfg->name); hfri.hfinfo.type = FT_UINT32; @@ -320,7 +320,7 @@ static void analyze_gop_config(gpointer k _U_, gpointer v, gpointer p _U_) { hf_register_info hfri = { NULL, {NULL, NULL, FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL}}; hfri.p_id = &(cfg->hfid); - hfri.hfinfo.name = g_strdup_printf("%s",cfg->name); + hfri.hfinfo.name = g_strdup(cfg->name); hfri.hfinfo.abbrev = g_strdup_printf("mate.%s",cfg->name); hfri.hfinfo.blurb = g_strdup_printf("%s id",cfg->name); hfri.hfinfo.type = FT_UINT32; @@ -436,7 +436,7 @@ static void analyze_gog_config(gpointer k _U_, gpointer v, gpointer p _U_) { /* create the hf array for this gog */ hfri.p_id = &(cfg->hfid); - hfri.hfinfo.name = g_strdup_printf("%s",cfg->name); + hfri.hfinfo.name = g_strdup(cfg->name); hfri.hfinfo.abbrev = g_strdup_printf("mate.%s",cfg->name); hfri.hfinfo.blurb = g_strdup_printf("%s Id",cfg->name); hfri.hfinfo.type = FT_UINT32; 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++; |