mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
xfs: Replace strncpy with memcpy
The changes modernizes the code by aligning it with current kernel best practices. It improves code clarity and consistency, as strncpy is deprecated as explained in Documentation/process/deprecated.rst. This change does not alter the functionality or introduce any behavioral changes. Suggested-by: Dave Chinner <david@fromorbit.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com> Signed-off-by: Marcelo Moreira <marcelomoreira1905@gmail.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Carlos Maiolino <cem@kernel.org>
This commit is contained in:
committed by
Carlos Maiolino
parent
851c4c96db
commit
33ddc796ec
@@ -185,7 +185,7 @@ xrep_symlink_salvage_inline(
|
||||
return 0;
|
||||
|
||||
nr = min(XFS_SYMLINK_MAXLEN, xfs_inode_data_fork_size(ip));
|
||||
strncpy(target_buf, ifp->if_data, nr);
|
||||
memcpy(target_buf, ifp->if_data, nr);
|
||||
return nr;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user