diff --git a/libfuse-lite/fuse.c b/libfuse-lite/fuse.c index 256bed0f..6f9242b7 100644 --- a/libfuse-lite/fuse.c +++ b/libfuse-lite/fuse.c @@ -463,7 +463,7 @@ static char *add_name(char *buf, char *s, const char *name) return NULL; } #endif /* __SOLARIS__ */ - strncpy(s, name, len); + memcpy(s, name, len); s--; *s = '/'; diff --git a/libfuse-lite/fuse_lowlevel.c b/libfuse-lite/fuse_lowlevel.c index fb93b074..a2a58278 100644 --- a/libfuse-lite/fuse_lowlevel.c +++ b/libfuse-lite/fuse_lowlevel.c @@ -247,7 +247,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);