]> pd.if.org Git - pdclib/blobdiff - functions/string/strlen.c
Merged PDPCLIB and Therx code.
[pdclib] / functions / string / strlen.c
index 62ab7a147cee519f17d70f5e3cbc3ee0f9f3f958..9dfc38fed0a058172142e2441820e6b2aaffa1c0 100644 (file)
@@ -6,3 +6,24 @@
 // ----------------------------------------------------------------------------
 
 size_t strlen( const char * s ) { /* TODO */ };
+
+/* Therx code
+{
+    const char * start = s1;
+    while (*s1)
+    {
+        s1++;
+    }
+    return s1 - start;
+}
+*/
+
+/* PDPC code - unreviewed
+{
+    const char *p;
+    
+    p = s;
+    while (*p != '\0') p++;
+    return ((size_t)(p - s));
+}
+*/