Skip to content

Commit 565837a

Browse files
fix stpcpy as well
1 parent ac9675f commit 565837a

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

libc/src/string/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ add_entrypoint_object(
8989
HDRS
9090
stpcpy.h
9191
DEPENDS
92-
.mempcpy
9392
.string_utils
9493
)
9594

libc/src/string/stpcpy.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include "src/string/stpcpy.h"
1010
#include "src/__support/macros/config.h"
11-
#include "src/string/mempcpy.h"
11+
#include "src/string/memory_utils/inline_memcpy.h"
1212
#include "src/string/string_utils.h"
1313

1414
#include "src/__support/common.h"
@@ -18,8 +18,8 @@ namespace LIBC_NAMESPACE_DECL {
1818
LLVM_LIBC_FUNCTION(char *, stpcpy,
1919
(char *__restrict dest, const char *__restrict src)) {
2020
size_t size = internal::string_length(src) + 1;
21-
char *result =
22-
reinterpret_cast<char *>(LIBC_NAMESPACE::mempcpy(dest, src, size));
21+
inline_memcpy(dest, src, size);
22+
char *result = dest + size;
2323

2424
if (result != nullptr)
2525
return result - 1;

0 commit comments

Comments
 (0)