decoder/opus: use std::copy_n() instead of memcpy()

This commit is contained in:
Max Kellermann 2013-10-24 20:06:50 +02:00
parent dae6ecb680
commit e4f41ff61d

View File

@ -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;
}
};