Decoupling Architectural-specific Code (#35)
[lunaix-os.git] / lunaix-os / libs / klibc / string / strcpy.c
index 88b5cb1ca2a02ab298e6f8b8a0532e59bcd0b454..04c85c9784db0f4ccbab8e8d6c27c19a8c4bd1b7 100644 (file)
@@ -1,6 +1,7 @@
 #include <klibc/string.h>
+#include <lunaix/compiler.h>
 
-char*
+char* weak
 strcpy(char* dest, const char* src)
 {
     char c;
@@ -9,11 +10,11 @@ strcpy(char* dest, const char* src)
         dest[i] = c;
         i++;
     }
-    dest[i] = '\0';
-    return dest;
+    dest[i++] = '\0';
+    return &dest[i];
 }
 
-char*
+char* weak
 strncpy(char* dest, const char* src, unsigned long n)
 {
     char c;