diff --git a/src/add-ons/kernel/file_systems/nfs4/RootInode.cpp b/src/add-ons/kernel/file_systems/nfs4/RootInode.cpp index 5278cf8f51..e79f832823 100644 --- a/src/add-ons/kernel/file_systems/nfs4/RootInode.cpp +++ b/src/add-ons/kernel/file_systems/nfs4/RootInode.cpp @@ -135,8 +135,7 @@ RootInode::_UpdateInfo(bool force) || fFileSystem->GetConfiguration().fEmulateNamedAttrs) fInfoCache.flags |= B_FS_HAS_MIME | B_FS_HAS_ATTR; - strncpy(fInfoCache.volume_name, fName, sizeof(fInfoCache.volume_name)); - fInfoCache.volume_name[sizeof(fInfoCache.volume_name) - 1] = '\0'; + strlcpy(fInfoCache.volume_name, fName, sizeof(fInfoCache.volume_name)); fInfoCacheExpire = time(NULL) + MetadataCache::kExpirationTime;