We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1063649 commit e93b912Copy full SHA for e93b912
1 file changed
tools/include/nolibc/string.h
@@ -187,12 +187,7 @@ char *strndup(const char *str, size_t maxlen)
187
static __attribute__((unused))
188
size_t strlcat(char *dst, const char *src, size_t size)
189
{
190
- size_t len = 0;
191
-
192
- for (; len < size; len++) {
193
- if (dst[len] == '\0')
194
- break;
195
- }
+ size_t len = strnlen(dst, size);
196
197
/*
198
* We want len < size-1. But as size is unsigned and can wrap
0 commit comments