summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorAntonio Nino Diaz <antonio.ninodiaz@arm.com>2018-08-13 19:51:26 +0100
committerAntonio Nino Diaz <antonio.ninodiaz@arm.com>2018-08-22 10:26:04 +0100
commit8bb6de151892f20afcffe7cfa114710e0a47d6c6 (patch)
tree1d1a2fd4fb664b13c10c53c83f96f0d242d892aa /lib/libc
parent4661abc7c44926ac34ce96deb9e332a6804a2520 (diff)
libc: Introduce cdefs.h, assert.h and strlen.c
Change-Id: I76091d52571f1950111c4b1670d5fc3883607715 Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/strlen.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/libc/strlen.c b/lib/libc/strlen.c
new file mode 100644
index 00000000..3c276300
--- /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 <string.h>
+
+size_t strlen(const char *s)
+{
+ const char *cursor = s;
+
+ while (*cursor)
+ cursor++;
+
+ return cursor - s;
+}