]> pd.if.org Git - pdclib/blobdiff - functions/string/strncat.c
Merged PDPCLIB and Therx code.
[pdclib] / functions / string / strncat.c
index 624ac0387933ed1210f859e67f78a9519febfdd4..1bc202398636595fb72da31940acc6c4d47bdd88 100644 (file)
@@ -6,3 +6,21 @@
 // ----------------------------------------------------------------------------
 
 char * strncat( char * restrict s1, const char * restrict s2, size_t n ) { /* TODO */ };
+
+/* PDPC code - unreviewed
+{
+    char *p = s1;
+    size_t x = 0;
+    
+    while (*p != '\0') p++;
+    while ((*s2 != '\0') && (x < n))
+    {
+        *p = *s2;
+        p++;
+        s2++;
+        x++;
+    }
+    *p = '\0';
+    return (s1);
+}
+*/