mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-16 14:50:17 +00:00
SCUMM: Fix deepcode warning
- use memcpy() instead of strcpy() to insert linebreak character
This commit is contained in:
parent
145617ce69
commit
1a0c320616
@ -542,7 +542,6 @@ int CharsetRenderer::getStringWidth(int arg, const byte *text) {
|
||||
|
||||
void CharsetRenderer::addLinebreaks(int a, byte *str, int pos, int maxwidth) {
|
||||
int lastKoreanLineBreak = -1;
|
||||
char tmpStrBuf[512];
|
||||
int origPos = pos;
|
||||
int lastspace = -1;
|
||||
int curw = 1;
|
||||
@ -550,6 +549,8 @@ void CharsetRenderer::addLinebreaks(int a, byte *str, int pos, int maxwidth) {
|
||||
int oldID = getCurID();
|
||||
int code = (_vm->_game.heversion >= 80) ? 127 : 64;
|
||||
|
||||
int strLength = _vm->resStrLen(str);
|
||||
|
||||
while ((chr = str[pos++]) != 0) {
|
||||
if (_vm->_game.heversion >= 72) {
|
||||
if (chr == code) {
|
||||
@ -658,8 +659,8 @@ void CharsetRenderer::addLinebreaks(int a, byte *str, int pos, int maxwidth) {
|
||||
lastspace = -1;
|
||||
lastKoreanLineBreak = -1;
|
||||
} else {
|
||||
strcpy(tmpStrBuf, (char*)(str + lastKoreanLineBreak));
|
||||
strcpy((char*)(str + lastKoreanLineBreak + 1), tmpStrBuf);
|
||||
byte* breakPtr = str + lastKoreanLineBreak;
|
||||
memmove(breakPtr + 1, breakPtr, strLength - lastKoreanLineBreak + 1);
|
||||
str[lastKoreanLineBreak] = 0xD;
|
||||
curw = 1;
|
||||
pos = lastKoreanLineBreak + 1;
|
||||
|
Loading…
Reference in New Issue
Block a user