tools/nolibc: Fix strlcpy() return code and size usage
authorRodrigo Campos <rodrigo@sdfg.com.ar>
Sun, 18 Feb 2024 19:51:05 +0000 (16:51 -0300)
committerThomas Weißschuh <linux@weissschuh.net>
Wed, 10 Apr 2024 21:19:02 +0000 (23:19 +0200)
commitfbffce819e5ac151e137f881b89a9c1da0ebb76c
tree70547087330d00a1d215f4d01f018ac0988f5099
parent34d232c39a1e05ba734dc6ad9dc01d15788cd91d
tools/nolibc: Fix strlcpy() return code and size usage

The return code should always be strlen(src), and we should copy at most
size-1 bytes.

While we are there, make sure to null-terminate the dst buffer if we
copied something.

Signed-off-by: Rodrigo Campos <rodrigo@sdfg.com.ar>
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
tools/include/nolibc/string.h