Skip to content
Commit 34d232c3 authored by Rodrigo Campos's avatar Rodrigo Campos Committed by Thomas Weißschuh
Browse files

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: default avatarRodrigo Campos <rodrigo@sdfg.com.ar>
Signed-off-by: default avatarThomas Weißschuh <linux@weissschuh.net>
parent 689230b6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment