tools/nolibc: Fix strlcat() return code and size usage
The return code should always be strlen(src) + strnlen(dst, size). Let's make sure to copy at most size-1 bytes from src and null-terminate the dst buffer if we did copied something. While we can use strnlen() and strncpy() to implement strlcat(), this is simple enough and results in shorter code when compiled. Signed-off-by:Rodrigo Campos <rodrigo@sdfg.com.ar> Signed-off-by:
Thomas Weißschuh <linux@weissschuh.net>
Showing
Please register or sign in to comment