MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / strlcpy

Function strlcpy

system/lib/llvm-libc/src/string/string_utils.h:215–224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

213}
214
215LIBC_INLINE size_t strlcpy(char *__restrict dst, const char *__restrict src,
216 size_t size) {
217 size_t len = internal::string_length(src);
218 if (!size)
219 return len;
220 size_t n = len < size - 1 ? len : size - 1;
221 __builtin_memcpy(dst, src, n);
222 dst[n] = '\0';
223 return len;
224}
225
226template <bool ReturnNull = true>
227LIBC_INLINE constexpr static char *strchr_implementation(const char *src,

Callers 2

LLVM_LIBC_FUNCTIONFunction · 0.70
LLVM_LIBC_FUNCTIONFunction · 0.70

Calls 1

string_lengthFunction · 0.85

Tested by

no test coverage detected