tools/nolibc/string: add strncpy() and strlcpy()
authorWilly Tarreau <w@1wt.eu>
Mon, 7 Feb 2022 16:23:42 +0000 (17:23 +0100)
committerPaul E. McKenney <paulmck@kernel.org>
Thu, 24 Feb 2022 17:56:46 +0000 (09:56 -0800)
commitb0da4b903d9758a713e97bd786bce635ee20a663
treeaf20c1e9dec7e77e5b1017dc830bf8114c8ac8de
parenta79fa17941bb23247d2d739485e6567d94c391f1
tools/nolibc/string: add strncpy() and strlcpy()

These are minimal variants. strncpy() always fills the destination for
<size> chars, while strlcpy() copies no more than <size> including the
zero and returns the source's length. The respective sizes on various
archs are:

  strncpy(): x86:0x1f mips:0x30 arm:0x20
  strlcpy(): x86:0x17 mips:0x34 arm:0x1a

Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
tools/include/nolibc/string.h