git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Merge branch 'master' into prog-loader
[lunaix-os.git]
/
lunaix-os
/
usr
/
libc
/
string.c
diff --git
a/lunaix-os/usr/libc/string.c
b/lunaix-os/usr/libc/string.c
index 2e34dc7460cfa65a2a22d2c606c08a6649a43fd3..280cbbe3c8b18fea2440d3010293a1aa3f3acfd6 100644
(file)
--- a/
lunaix-os/usr/libc/string.c
+++ b/
lunaix-os/usr/libc/string.c
@@
-41,4
+41,17
@@
strncpy(char* dest, const char* src, size_t n)
while (i <= n)
dest[i++] = 0;
return dest;
-}
\ No newline at end of file
+}
+
+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;
+}