mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 13:50:13 +00:00
GRIFFON: Don't use unsafe strcat and strcpy
This commit is contained in:
parent
f26ce1e4ff
commit
0a0d21b904
@ -553,7 +553,7 @@ void GriffonEngine::damageNPC(int npcnum, int damage, int spell) {
|
||||
int fcol;
|
||||
|
||||
if (damage == 0) {
|
||||
strcpy(line, "miss!");
|
||||
Common::strcpy_s(line, "miss!");
|
||||
fcol = 2;
|
||||
} else {
|
||||
int ratio = 0;
|
||||
@ -1021,7 +1021,7 @@ void GriffonEngine::damagePlayer(int damage) {
|
||||
|
||||
sprintf(line, "-%i", damage);
|
||||
if (damage == 0)
|
||||
strcpy(line, "miss!");
|
||||
Common::strcpy_s(line, "miss!");
|
||||
|
||||
addFloatText(line, _player.px + 12 - 4 * strlen(line), _player.py + 16, 4);
|
||||
|
||||
|
@ -349,7 +349,7 @@ void GriffonEngine::configMenu() {
|
||||
int vol = (i ==18 ? config.musicVol : config.effectsVol) * 9 / 255;
|
||||
vol = CLIP(vol, 0, 9);
|
||||
|
||||
strcpy(line, "[----------]");
|
||||
Common::strcpy_s(line, "[----------]");
|
||||
line[vol + 1] = 'X';
|
||||
optionValues[i] = line;
|
||||
} else if (i > 21)
|
||||
@ -579,7 +579,7 @@ void GriffonEngine::renderSaveStates() {
|
||||
drawString(_videoBuffer2, line, sx, sy, cc);
|
||||
|
||||
if (_playera.level == 22)
|
||||
strcpy(line, "Level: MAX");
|
||||
Common::strcpy_s(line, "Level: MAX");
|
||||
else
|
||||
sprintf(line, "Level: %i", _playera.level);
|
||||
|
||||
|
@ -310,7 +310,7 @@ void GriffonEngine::drawHud() {
|
||||
|
||||
sprintf(line, "Level : %i", _player.level);
|
||||
if (_player.level == _player.maxLevel)
|
||||
strcpy(line, "Level : MAX");
|
||||
Common::strcpy_s(line, "Level : MAX");
|
||||
drawString(_videoBuffer, line, sx, sy + 8, 0);
|
||||
|
||||
// experience
|
||||
|
@ -58,7 +58,7 @@ void GriffonEngine::addFloatText(const char *stri, float xloc, float yloc, int c
|
||||
_floatText[i].x = xloc;
|
||||
_floatText[i].y = yloc;
|
||||
_floatText[i].col = col;
|
||||
strcpy(_floatText[i].text, stri);
|
||||
Common::strcpy_s(_floatText[i].text, 64, stri);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1637,20 +1637,20 @@ void GriffonEngine::updateSpells() {
|
||||
}
|
||||
|
||||
char line[256];
|
||||
strcpy(line, "Found... nothing...");
|
||||
Common::strcpy_s(line, "Found... nothing...");
|
||||
|
||||
for (int f1 = 0; f1 < 5; f1++) {
|
||||
if (foundel[f1] && !_player.foundSpell[f1]) {
|
||||
_player.foundSpell[f1] = 1;
|
||||
_player.spellCharge[f1] = 0;
|
||||
if (f1 == 1)
|
||||
strcpy(line, "Found... Water Essence");
|
||||
Common::strcpy_s(line, "Found... Water Essence");
|
||||
if (f1 == 2)
|
||||
strcpy(line, "Found... Metal Essence");
|
||||
Common::strcpy_s(line, "Found... Metal Essence");
|
||||
if (f1 == 3)
|
||||
strcpy(line, "Found... Earth Essence");
|
||||
Common::strcpy_s(line, "Found... Earth Essence");
|
||||
if (f1 == 4)
|
||||
strcpy(line, "Found... Fire Essence");
|
||||
Common::strcpy_s(line, "Found... Fire Essence");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user