Skip to content
Commit 29774f3f authored by Mathieu Malaterre's avatar Mathieu Malaterre Committed by Linus Torvalds
Browse files

fs/hfsplus/xattr.c: replace strncpy with memcpy

strncpy() was used to copy a fixed size buffer.  Since NUL-terminating
string is not required here, prefer a memcpy function.  The generated
code (ppc32) remains the same.

Silence the following warning triggered using W=1:

  fs/hfsplus/xattr.c:410:3: warning: 'strncpy' output truncated before terminating nul copying 4 bytes from a string of the same length [-Wstringop-truncation]

Link: http://lkml.kernel.org/r/20190529113341.11972-1-malat@debian.org


Signed-off-by: default avatarMathieu Malaterre <malat@debian.org>
Reviewed-by: default avatarVyacheslav Dubeyko <slava@dubeyko.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent a9fba24c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment