diff options
author | Johannes Schickel | 2010-05-05 17:54:12 +0000 |
---|---|---|
committer | Johannes Schickel | 2010-05-05 17:54:12 +0000 |
commit | caf31ee5afb61a88342176473bf77ebddc098ca4 (patch) | |
tree | bc0ec2794958a722d314af38c00d65a9a058b0cf /sound/softsynth/mt32/synth.cpp | |
parent | 7da8c8949b56835cf87f88ffd6cfb8204c711592 (diff) | |
download | scummvm-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/mt32/synth.cpp')
-rw-r--r-- | sound/softsynth/mt32/synth.cpp | 5 |
1 files changed, 3 insertions, 2 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) { |