SCUMM: use memset for initialization

This commit is contained in:
BLooperZ 2019-12-30 22:31:35 +02:00 committed by Eugene Sandulenko
parent 2105313d8b
commit e411a539cb

View File

@ -1045,7 +1045,8 @@ void ScummEngine::drawString(int a, const byte *msg) {
while (ltext[ll] == 0xFF) {
ll += 4;
}
byte lenbuf[270] = {0};
byte lenbuf[270];
memset(lenbuf, 0, sizeof(lenbuf));
int pos = ll;
while (ltext[pos]) {
if ((ltext[pos] == 0xFF || (_game.version <= 6 && ltext[pos] == 0xFE)) && ltext[pos+1] == 8) {
@ -1104,7 +1105,8 @@ void ScummEngine::drawString(int a, const byte *msg) {
while (ltext[ll] == 0xFF) {
ll += 4;
}
byte lenbuf[270] = {0};
byte lenbuf[270];
memset(lenbuf, 0, sizeof(lenbuf));
memcpy(lenbuf, ltext, ll);
int u = ll;
while (ltext[u]) {
@ -1753,4 +1755,4 @@ void ScummEngine::translateText(const byte *text, byte *trans_buff) {
memcpy(trans_buff, text, resStrLen(text) + 1);
}
} // End of namespace Scumm
} // End of namespace Scumm