From e4f41ff61d0b5f2c78e1d65e87f52eeecfedb21d Mon Sep 17 00:00:00 2001
From: Max Kellermann <max@duempel.org>
Date: Thu, 24 Oct 2013 20:06:50 +0200
Subject: [PATCH] decoder/opus: use std::copy_n() instead of memcpy()

---
 src/decoder/OpusReader.hxx | 5 +++--
 1 file 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;
 	}
 };