mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-26 07:34:06 +00:00
Add a simple implementation of strncpy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11672 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
54e4e20286
commit
3da125839d
@ -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