summaryrefslogtreecommitdiff
path: root/src/libstddjb/str_len.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstddjb/str_len.c')
-rw-r--r--src/libstddjb/str_len.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/libstddjb/str_len.c b/src/libstddjb/str_len.c
index 4db2f4c..75bd1f2 100644
--- a/src/libstddjb/str_len.c
+++ b/src/libstddjb/str_len.c
@@ -8,14 +8,9 @@
unsigned int str_len (char const *s)
{
- register char const *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;
- }
+ register unsigned int len = 0 ;
+ while (*s++) len++ ;
+ return len ;
}
#endif