aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/OpusReader.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/decoder/OpusReader.hxx')
-rw-r--r--src/decoder/OpusReader.hxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/decoder/OpusReader.hxx b/src/decoder/OpusReader.hxx
index 1fd07b55c..7e161fd0f 100644
--- a/src/decoder/OpusReader.hxx
+++ b/src/decoder/OpusReader.hxx
@@ -21,7 +21,6 @@
#define MPD_OPUS_READER_HXX
#include "check.h"
-#include "string_util.h"
#include <stdint.h>
#include <string.h>
@@ -91,7 +90,10 @@ public:
if (src == nullptr)
return nullptr;
- return strndup(src, length);
+ char *dest = new char[length + 1];
+ memcpy(dest, src, length);
+ dest[length] = 0;
+ return dest;
}
};