From c8cc8bb60c77a4908be2757c78972c51c2ff700d Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Sun, 13 Apr 2003 23:45:35 +0000 Subject: Merge of Simo's strncat -> StrnCpy fix. (This used to be commit a2b1a7533ed997848f9dc0fcd1ffc3d4b4e8117d) --- source3/smbd/reply.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'source3/smbd') diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 0ccb4d0e9d..d655184042 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -3104,11 +3104,10 @@ static BOOL resolve_wildcards(const char *name1, char *name2) available_space = sizeof(pstring) - PTR_DIFF(pname2, name2); - StrnCpy(pname2, root2, available_space-1); - available_space -= strlen(root2); if (ext2[0]) { - strncat(pname2, ".", available_space-1); - strncat(pname2, ext2, available_space-2); + snprintf(pname2, available_space - 1, "%s.%s", root2, ext2); + } else { + StrnCpy(pname2, root2, available_space - 1); } return(True); -- cgit