diff options
| author | Marcelo Moreira <marcelomoreira1905@gmail.com> | 2025-08-27 19:17:07 -0300 |
|---|---|---|
| committer | Carlos Maiolino <cem@kernel.org> | 2025-09-05 10:18:59 +0200 |
| commit | 33ddc796ecbd50cd6211aa9e9eddbf4567038b49 (patch) | |
| tree | 589a1b2b2ef91c4fa5dc3ccfb0d6452de07d53f4 /fs/xfs | |
| parent | 851c4c96db001f51bdad1432aa54549c7fe2c63e (diff) | |
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>
Diffstat (limited to 'fs/xfs')
| -rw-r--r-- | fs/xfs/scrub/symlink_repair.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xfs/scrub/symlink_repair.c b/fs/xfs/scrub/symlink_repair.c index 953ce7be78dc..5902398185a8 100644 --- a/fs/xfs/scrub/symlink_repair.c +++ b/fs/xfs/scrub/symlink_repair.c @@ -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; } |
