Browse Source

Replace memcpy with std::copy in `copyAndReturn`

Filip Klembara 4 years ago
parent
commit
983b5759f3
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/capi.cpp

+ 1 - 1
src/capi.cpp

@@ -275,7 +275,7 @@ int copyAndReturn(std::vector<T> 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());
 }