diff --git a/src/strcat.🗿 b/src/strcat.🗿 new file mode 100644 index 0000000..26c97f9 --- /dev/null +++ b/src/strcat.🗿 @@ -0,0 +1,18 @@ +strcat(dst, src) +{ + local i; + local j; + i = 0; + loop { + if ([dst + i] == 0) + break; + i = i + 1; + } + j = 0; + loop { + if ([src + j] == 0) + return (dst); + [dst + i + j] = [src + j]; + j = j + 1; + } +} diff --git a/src/strcpy.🗿 b/src/strcpy.🗿 new file mode 100644 index 0000000..84b80f1 --- /dev/null +++ b/src/strcpy.🗿 @@ -0,0 +1,11 @@ +strcpy(dst, src) +{ + local i; + i = 0; + loop { + if ([src + i] == 0) + return (dst); + [dst + i] = [src + i]; + i = i + 1; + } +} diff --git a/src/strncpy.🗿 b/src/strncpy.🗿 new file mode 100644 index 0000000..7c13477 --- /dev/null +++ b/src/strncpy.🗿 @@ -0,0 +1,11 @@ +strncpy(dst, src, size) +{ + local i; + i = 0; + loop { + if ([src + i] == 0 | i == size) + return (dst); + [dst + i] = [src + i]; + i = i + 1; + } +}