mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
tools/nolibc/string: remove open-coded strnlen()
The same header already defines an implementation of strnlen(), so use it. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
This commit is contained in:
parent
1063649cf5
commit
e93b912ecf
1 changed files with 1 additions and 6 deletions
|
@ -187,12 +187,7 @@ char *strndup(const char *str, size_t maxlen)
|
|||
static __attribute__((unused))
|
||||
size_t strlcat(char *dst, const char *src, size_t size)
|
||||
{
|
||||
size_t len = 0;
|
||||
|
||||
for (; len < size; len++) {
|
||||
if (dst[len] == '\0')
|
||||
break;
|
||||
}
|
||||
size_t len = strnlen(dst, size);
|
||||
|
||||
/*
|
||||
* We want len < size-1. But as size is unsigned and can wrap
|
||||
|
|
Loading…
Add table
Reference in a new issue