Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: strnlen_copy.c
- Revision:
- 0:be95bfb06686
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/strnlen_copy.c Mon Jan 17 13:20:09 2022 +0000
@@ -0,0 +1,11 @@
+#include <stddef.h>
+
+size_t
+strnlen (const char *s, size_t maxlen)
+{
+ size_t i;
+ for (i = 0; i < maxlen; ++i)
+ if (s[i] == '\0')
+ break;
+ return i;
+}
