From 983b5759f31ee1978ae4e72e766f70f429acad2c Mon Sep 17 00:00:00 2001 From: Filip Klembara Date: Thu, 3 Jun 2021 09:30:17 +0200 Subject: [PATCH] Replace memcpy with std::copy in `copyAndReturn` --- src/capi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/capi.cpp b/src/capi.cpp index 30c3b7f..f1e08ec 100644 --- a/src/capi.cpp +++ b/src/capi.cpp @@ -275,7 +275,7 @@ int copyAndReturn(std::vector b, T *buffer, int size) { if (size < int(b.size())) return RTC_ERR_TOO_SMALL; - memcpy(buffer, b.data(), b.size() * sizeof(*buffer)); + std::copy(b.begin(), b.end(), buffer); return int(b.size()); }