nfs4: Take advantage of strlcpy()

This commit is contained in:
Pawel Dziepak 2013-03-19 02:32:05 +01:00
parent 4fa87bf152
commit 55ca54ccf5

View File

@ -135,8 +135,7 @@ RootInode::_UpdateInfo(bool force)
|| fFileSystem->GetConfiguration().fEmulateNamedAttrs) || fFileSystem->GetConfiguration().fEmulateNamedAttrs)
fInfoCache.flags |= B_FS_HAS_MIME | B_FS_HAS_ATTR; fInfoCache.flags |= B_FS_HAS_MIME | B_FS_HAS_ATTR;
strncpy(fInfoCache.volume_name, fName, sizeof(fInfoCache.volume_name)); strlcpy(fInfoCache.volume_name, fName, sizeof(fInfoCache.volume_name));
fInfoCache.volume_name[sizeof(fInfoCache.volume_name) - 1] = '\0';
fInfoCacheExpire = time(NULL) + MetadataCache::kExpirationTime; fInfoCacheExpire = time(NULL) + MetadataCache::kExpirationTime;