aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder
diff options
context:
space:
mode:
Diffstat (limited to 'src/decoder')
-rw-r--r--src/decoder/OpusReader.hxx5
1 files changed, 3 insertions, 2 deletions
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 <algorithm>
+
#include <stdint.h>
#include <string.h>
@@ -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;
}
};