aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-24 20:06:50 +0200
committerMax Kellermann <max@duempel.org>2013-10-24 20:06:50 +0200
commite4f41ff61d0b5f2c78e1d65e87f52eeecfedb21d (patch)
tree5e0c04eb006e984df9f22f19930e1d9ca8b0391f /src
parentdae6ecb680c8d46e055a9c103b9a3536df51d230 (diff)
downloadmpd-e4f41ff61d0b5f2c78e1d65e87f52eeecfedb21d.tar.gz
mpd-e4f41ff61d0b5f2c78e1d65e87f52eeecfedb21d.tar.xz
mpd-e4f41ff61d0b5f2c78e1d65e87f52eeecfedb21d.zip
decoder/opus: use std::copy_n() instead of memcpy()
Diffstat (limited to 'src')
-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;
}
};