]> git.baikalelectronics.ru Git - kernel.git/commit
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, 21 Apr 2022 00:05:44 +0000 (17:05 -0700)
commit55229e1bac2b89d0963ac1a38810f0ea8909deb1
treeb24cf7c9f79183c1a70ec3a7a44a970b1fc82f3c
parent02178775eb152e9ec6d3139a5a4c414e28e6f72a
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