diff --git a/src/decoder/OpusReader.hxx b/src/decoder/OpusReader.hxx index 7e161fd0f..069fa54ca 100644 --- a/src/decoder/OpusReader.hxx +++ b/src/decoder/OpusReader.hxx @@ -22,6 +22,8 @@ #include "check.h" +#include + #include #include @@ -91,8 +93,7 @@ public: return nullptr; char *dest = new char[length + 1]; - memcpy(dest, src, length); - dest[length] = 0; + *std::copy_n(src, length, dest) = 0; return dest; } };