diff options
-rw-r--r-- | source3/smbd/reply.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 1c7e23a20f..b2dab2fea2 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -3101,11 +3101,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); |