Implement APIC, RTC, basic ACPI parser and timer support
[lunaix-os.git] / lunaix-os / libs / klibc / string / strcpy.c
diff --git a/lunaix-os/libs/klibc/string/strcpy.c b/lunaix-os/libs/klibc/string/strcpy.c
new file mode 100644 (file)
index 0000000..1258606
--- /dev/null
@@ -0,0 +1,23 @@
+#include <klibc/string.h>
+
+char*
+strcpy(char* dest, const char* src) {
+    char c;
+    unsigned int i = 0;
+    while ((c = src[i]))
+    {
+        dest[i] = c;
+        i++;
+    }
+    dest[i] = '\0';
+    return dest;
+}
+
+char*
+strncpy(char* dest, const char* src, size_t n) {
+    char c;
+    unsigned int i = 0;
+    while ((c = src[i]) && i < n) dest[i++] = c;
+    while (i < n) dest[i++] = 0;
+    return dest;
+}
\ No newline at end of file