diff --git a/lib/fuse.c b/lib/fuse.c index fa0a8149b..a428d1d90 100644 --- a/lib/fuse.c +++ b/lib/fuse.c @@ -905,7 +905,7 @@ static char *add_name(char **buf, unsigned *bufsize, char *s, const char *name) *bufsize = newbufsize; } s -= len; - strncpy(s, name, len); + memcpy(s, name, len); s--; *s = '/'; diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c index ff03c6301..a345cd029 100644 --- a/lib/fuse_lowlevel.c +++ b/lib/fuse_lowlevel.c @@ -260,7 +260,7 @@ char *fuse_add_dirent(char *buf, const char *name, const struct stat *stbuf, dirent->off = off; dirent->namelen = namelen; dirent->type = (stbuf->st_mode & 0170000) >> 12; - strncpy(dirent->name, name, namelen); + memcpy(dirent->name, name, namelen); if (padlen) memset(buf + entlen, 0, padlen);