aboutsummaryrefslogtreecommitdiff
path: root/sound/softsynth
diff options
context:
space:
mode:
authorJohannes Schickel2010-05-05 17:54:12 +0000
committerJohannes Schickel2010-05-05 17:54:12 +0000
commitcaf31ee5afb61a88342176473bf77ebddc098ca4 (patch)
treebc0ec2794958a722d314af38c00d65a9a058b0cf /sound/softsynth
parent7da8c8949b56835cf87f88ffd6cfb8204c711592 (diff)
downloadscummvm-rg350-caf31ee5afb61a88342176473bf77ebddc098ca4.tar.gz
scummvm-rg350-caf31ee5afb61a88342176473bf77ebddc098ca4.tar.bz2
scummvm-rg350-caf31ee5afb61a88342176473bf77ebddc098ca4.zip
Replace various strncpy usages by strlcpy.
svn-id: r48955
Diffstat (limited to 'sound/softsynth')
-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++)