Commit 33ddc796 authored by Marcelo Moreira's avatar Marcelo Moreira Committed by Carlos Maiolino
Browse files

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: default avatarDave Chinner <david@fromorbit.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarCarlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: default avatarMarcelo Moreira <marcelomoreira1905@gmail.com>
Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
Signed-off-by: default avatarCarlos Maiolino <cem@kernel.org>
parent 851c4c96
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
}