From b0cdcf40ab15cdad5efea3602bc0665fe4aefb88 Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Thu, 27 Oct 2005 10:11:22 +0000 Subject: get rid of the last two strcpy from epan/dissectors svn path=/trunk/; revision=16342 --- epan/dissectors/packet-nfs.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/epan/dissectors/packet-nfs.c b/epan/dissectors/packet-nfs.c index 0ed98739f8..8c343d48fd 100644 --- a/epan/dissectors/packet-nfs.c +++ b/epan/dissectors/packet-nfs.c @@ -744,8 +744,7 @@ nfs_full_name_snoop(nfs_name_snoop_t *nns, int *len, unsigned char **name, unsig *name = g_malloc((*len)+1); *pos = *name; - strcpy(*pos, nns->name); - *pos += nns->name_len; + *pos += g_snprintf(*pos, (*len)+1, "%s", nns->name); return; } @@ -759,13 +758,7 @@ nfs_full_name_snoop(nfs_name_snoop_t *nns, int *len, unsigned char **name, unsig nfs_full_name_snoop(parent_nns, len, name, pos); if(*name){ /* make sure components are '/' separated */ - if( (*pos)[-1] != '/'){ - **pos='/'; - (*pos)++; - **pos=0; - } - strcpy(*pos, nns->name); - *pos += nns->name_len; + *pos += g_snprintf(*pos, (*len)+1, "%s%s", ((*pos)[-1]!='/')?"/":"", nns->name); } return; } -- cgit v1.2.3