We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0fdb865 commit 530268cCopy full SHA for 530268c
libc/src/wchar/wcscat.cpp
@@ -19,10 +19,11 @@ namespace LIBC_NAMESPACE_DECL {
19
LLVM_LIBC_FUNCTION(wchar_t *, wcscat,
20
(wchar_t *__restrict s1, const wchar_t *__restrict s2)) {
21
size_t size_1 = internal::string_length(s1);
22
- size_t size_2 = internal::string_length(s2);
23
- for (size_t i = 0; i <= size_2; i++) {
+ size_t i = 0;
+ for (; s2[i] != L'\0'; i++) {
24
s1[size_1 + i] = s2[i];
25
}
26
+ s1[size_1 + i] = L'\0';
27
return s1;
28
29
0 commit comments