aboutsummaryrefslogtreecommitdiff
path: root/sound/softsynth/mt32
diff options
context:
space:
mode:
Diffstat (limited to 'sound/softsynth/mt32')
-rw-r--r--sound/softsynth/mt32/synth.cpp5
-rw-r--r--sound/softsynth/mt32/tables.cpp2
2 files changed, 4 insertions, 3 deletions
diff --git a/sound/softsynth/mt32/synth.cpp b/sound/softsynth/mt32/synth.cpp
index b3f8d81719..6a16db22ec 100644
--- a/sound/softsynth/mt32/synth.cpp
+++ b/sound/softsynth/mt32/synth.cpp
@@ -25,6 +25,8 @@
#include "mt32emu.h"
+#include "common/str.h"
+
#if defined(MACOSX) || defined(SOLARIS) || defined(__MINGW32__)
// Older versions of Mac OS X didn't supply a powf function, so using it
// will cause a binary incompatibility when trying to run a binary built
@@ -345,8 +347,7 @@ bool Synth::initRhythmTimbre(int timbreNum, const Bit8u *mem, unsigned int memLe
memcpy(&timbre->common, mem, 14);
unsigned int memPos = 14;
char drumname[11];
- strncpy(drumname, timbre->common.name, 10);
- drumname[10] = 0;
+ Common::strlcpy(drumname, timbre->common.name, 11);
for (int t = 0; t < 4; t++) {
if (((timbre->common.pmute >> t) & 0x1) == 0x1) {
if (memPos + 58 >= memLen) {
diff --git a/sound/softsynth/mt32/tables.cpp b/sound/softsynth/mt32/tables.cpp
index 571750ee99..b0414154dc 100644
--- a/sound/softsynth/mt32/tables.cpp
+++ b/sound/softsynth/mt32/tables.cpp
@@ -614,7 +614,7 @@ bool Tables::initNotes(Synth *synth, PCMWaveEntry *pcmWaves, float rate, float m
File *file = NULL;
char header[20];
- strncpy(header, "MT32WAVE", 8);
+ memcpy(header, "MT32WAVE", 8);
int pos = 8;
// Version...
for (int i = 0; i < 4; i++)