diff options
Diffstat (limited to 'engines/scumm/imuse')
-rw-r--r-- | engines/scumm/imuse/imuse.cpp | 9 | ||||
-rw-r--r-- | engines/scumm/imuse/imuse_player.cpp | 6 |
2 files changed, 7 insertions, 8 deletions
diff --git a/engines/scumm/imuse/imuse.cpp b/engines/scumm/imuse/imuse.cpp index 50a13308d8..1d52539ab5 100644 --- a/engines/scumm/imuse/imuse.cpp +++ b/engines/scumm/imuse/imuse.cpp @@ -1468,8 +1468,6 @@ void IMuseInternal::initMidiDriver(TimerCallbackInfo *info) { void IMuseInternal::initMT32(MidiDriver *midi) { byte buffer[52]; - char info[256] = "ScummVM "; - int len; // Reset the MT-32 midi->sysEx((const byte *) "\x41\x10\x16\x12\x7f\x00\x00\x01\x00", 9); @@ -1485,15 +1483,16 @@ void IMuseInternal::initMT32(MidiDriver *midi) { _system->delayMillis(250); // Compute version string (truncated to 20 chars max.) - strcat(info, gScummVMVersion); - len = strlen(info); + Common::String infoStr = "ScummVM "; + infoStr += gScummVMVersion; + int len = infoStr.size(); if (len > 20) len = 20; // Display a welcome message on MT-32 displays. memcpy(&buffer[0], "\x41\x10\x16\x12\x20\x00\x00", 7); memcpy(&buffer[7], " ", 20); - memcpy(buffer + 7 + (20 - len) / 2, info, len); + memcpy(buffer + 7 + (20 - len) / 2, infoStr.c_str(), len); byte checksum = 0; for (int i = 4; i < 27; ++i) checksum -= buffer[i]; diff --git a/engines/scumm/imuse/imuse_player.cpp b/engines/scumm/imuse/imuse_player.cpp index b251e153cb..5e5c6ae351 100644 --- a/engines/scumm/imuse/imuse_player.cpp +++ b/engines/scumm/imuse/imuse_player.cpp @@ -408,12 +408,12 @@ void Player::sysEx(const byte *p, uint16 len) { if (!_scanning) { for (a = 0; a < len + 1 && a < 19; ++a) { - sprintf((char *)&buf[a * 3], " %02X", p[a]); - } // next for + snprintf((char *)&buf[a * 3], 3 * sizeof(char), " %02X", p[a]); + } if (a < len + 1) { buf[a * 3] = buf[a * 3 + 1] = buf[a * 3 + 2] = '.'; ++a; - } // end if + } buf[a * 3] = '\0'; debugC(DEBUG_IMUSE, "[%02d] SysEx:%s", _id, buf); } |