Commit e4f41ff6 authored by Max Kellermann's avatar Max Kellermann

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

parent dae6ecb6
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
#include "check.h" #include "check.h"
#include <algorithm>
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
...@@ -91,8 +93,7 @@ public: ...@@ -91,8 +93,7 @@ public:
return nullptr; return nullptr;
char *dest = new char[length + 1]; char *dest = new char[length + 1];
memcpy(dest, src, length); *std::copy_n(src, length, dest) = 0;
dest[length] = 0;
return dest; return dest;
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment