From 55ca54ccf590ee28d39fedcb2f78bb76eb2bd835 Mon Sep 17 00:00:00 2001 From: Pawel Dziepak Date: Tue, 19 Mar 2013 02:32:05 +0100 Subject: [PATCH] nfs4: Take advantage of strlcpy() --- src/add-ons/kernel/file_systems/nfs4/RootInode.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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;