aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/smb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/smb.c b/lib/smb.c
index 9648f6519..a8fcf4acc 100644
--- a/lib/smb.c
+++ b/lib/smb.c
@@ -345,7 +345,7 @@ static void smb_format_message(struct connectdata *conn, struct smb_header *h,
memset(h, 0, sizeof(*h));
h->nbt_length = htons((unsigned short) (sizeof(*h) - sizeof(unsigned int) +
len));
- strncpy((char *)h->magic, "\xffSMB", 4);
+ memcpy((char *)h->magic, "\xffSMB", 4);
h->command = cmd;
h->flags = SMB_FLAGS_CANONICAL_PATHNAMES | SMB_FLAGS_CASELESS_PATHNAMES;
h->flags2 = smb_swap16(SMB_FLAGS2_IS_LONG_NAME | SMB_FLAGS2_KNOWS_LONG_NAME);