From be58c81aff4cd4c0ccf43dbd7998da4a6a08c03b Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 21 Apr 2024 19:43:51 +0200 Subject: Adding upstream version 2.10.0+dfsg. Signed-off-by: Daniel Baumann --- lib/libc/strlen.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 lib/libc/strlen.c (limited to 'lib/libc/strlen.c') diff --git a/lib/libc/strlen.c b/lib/libc/strlen.c new file mode 100644 index 0000000..e4b79d9 --- /dev/null +++ b/lib/libc/strlen.c @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2018, Arm Limited and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include + +size_t strlen(const char *s) +{ + const char *cursor = s; + + while (*cursor) + cursor++; + + return cursor - s; +} -- cgit v1.2.3