toaruos/libc/wchar/wcscat.c

33 lines
461 B
C
Raw Normal View History

2018-06-25 09:45:32 +03:00
#include <wchar.h>
2018-06-25 14:15:45 +03:00
#include <stdio.h>
2018-06-25 09:45:32 +03:00
wchar_t * wcscat(wchar_t *dest, const wchar_t *src) {
wchar_t * end = dest;
while (*end != 0) {
++end;
}
while (*src) {
*end = *src;
end++;
src++;
}
*end = 0;
return dest;
}
2018-06-25 10:28:13 +03:00
wchar_t * wcsncat(wchar_t *dest, const wchar_t * src, size_t n) {
wchar_t * end = dest;
size_t c = 0;
while (*end != 0) {
++end;
}
while (*src && c < n) {
*end = *src;
end++;
src++;
c++;
}
*end = 0;
return dest;
}