aboutsummaryrefslogtreecommitdiff
path: root/str_len.c
diff options
context:
space:
mode:
Diffstat (limited to 'str_len.c')
-rw-r--r--str_len.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/str_len.c b/str_len.c
new file mode 100644
index 0000000..8411ebf
--- /dev/null
+++ b/str_len.c
@@ -0,0 +1,14 @@
+#include "str.h"
+
+unsigned int str_len(const char *s)
+{
+ register const char *t;
+
+ t = s;
+ for (;;) {
+ if (!*t) return t - s; ++t;
+ if (!*t) return t - s; ++t;
+ if (!*t) return t - s; ++t;
+ if (!*t) return t - s; ++t;
+ }
+}