aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/memory.c')
-rw-r--r--src/nvim/memory.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/nvim/memory.c b/src/nvim/memory.c
index 64deedefe5..789535e270 100644
--- a/src/nvim/memory.c
+++ b/src/nvim/memory.c
@@ -222,15 +222,14 @@ void *xmemdupz(const void *data, size_t len)
return memcpy(xmallocz(len), data, len);
}
-/// Duplicates `len` bytes of `src` to `dst` and zero terminates it.
-/// and returns a pointer to the allocated memory. If the allocation fails,
-/// the program dies.
+/// Copies `len` bytes of `src` to `dst` and zero terminates it.
///
/// @see {xstrlcpy}
/// @param[out] dst Buffer to store the result.
/// @param[in] src Buffer to be copied.
/// @param[in] len Number of bytes to be copied.
void *xmemcpyz(void *dst, const void *src, size_t len)
+ FUNC_ATTR_NONNULL_ALL FUNC_ATTR_NONNULL_RET
{
memcpy(dst, src, len);
((char *)dst)[len] = '\0';