提交 51ee4758 编辑于 作者: Rob Herring's avatar Rob Herring 提交者: Robert Nelson
浏览文件

ARM: boot: Add an implementation of strnlen for libfdt



Recent versions of libfdt add a dependency on strnlen. Copy the
implementation in lib/string.c here, so we can update libfdt.

Acked-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: default avatarRob Herring <robh@kernel.org>
上级 de297ce0
......@@ -65,6 +65,15 @@ size_t strlen(const char *s)
return sc - s;
}
size_t strnlen(const char *s, size_t count)
{
const char *sc;
for (sc = s; count-- && *sc != '\0'; ++sc)
/* nothing */;
return sc - s;
}
int memcmp(const void *cs, const void *ct, size_t count)
{
const unsigned char *su1 = cs, *su2 = ct, *end = su1 + count;
......
支持 Markdown
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册