mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-03 10:54:42 +00:00
Add a simple implementation of strncpy
llvm-svn: 11672
This commit is contained in:
parent
23ea81ddfb
commit
5b22f55e54
@ -35,6 +35,12 @@ char *strcpy(char *s1, const char *s2) {
|
||||
return dest;
|
||||
}
|
||||
|
||||
char *strncpy(char *s1, const char *s2, size_t n) {
|
||||
char *dest = s1;
|
||||
while (n-- && (*s1++ = *s2++));
|
||||
return dest;
|
||||
}
|
||||
|
||||
char *strcat(char *s1, const char *s2) {
|
||||
strcpy(s1+strlen(s1), s2);
|
||||
return s1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user