From e411a539cbc8de8758ed9294fd151b536402c309 Mon Sep 17 00:00:00 2001 From: BLooperZ Date: Mon, 30 Dec 2019 22:31:35 +0200 Subject: SCUMM: use memset for initialization --- engines/scumm/string.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'engines') diff --git a/engines/scumm/string.cpp b/engines/scumm/string.cpp index bbbb7d2a06..a94d4b8303 100644 --- a/engines/scumm/string.cpp +++ b/engines/scumm/string.cpp @@ -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 \ No newline at end of file +} // End of namespace Scumm -- cgit v1.2.3