mirror of
https://git.code.sf.net/p/ntfs-3g/ntfs-3g.git
synced 2024-11-23 10:04:00 +08:00
Avoided using a truncate strncpy() in the fuse library
Replace strncpy() by memcpy() when the exact size if known, thus silencing the compiler warnings.
This commit is contained in:
parent
688578c1a6
commit
ef61c82529
@ -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 = '/';
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user