refactor: elf parsing utility and exec related
[lunaix-os.git] / lunaix-os / usr / libc / string.c
index 2e34dc7460cfa65a2a22d2c606c08a6649a43fd3..726437c15a27be883ee4791aed3af876db1c9965 100644 (file)
@@ -41,4 +41,27 @@ strncpy(char* dest, const char* src, size_t n)
     while (i <= n)
         dest[i++] = 0;
     return dest;
+}
+
+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;
+}
+
+int
+strcmp(const char* a, const char* b)
+{
+    while (*a && *a == *b) {
+        a++;
+        b++;
+    }
+    return *a - *b;
 }
\ No newline at end of file