GNAP: Don't use unsafe sprintf and vsprintf

This commit is contained in:
Le Philousophe 2022-10-23 15:22:58 +02:00 committed by Eugene Sandulenko
parent 6d3a10c631
commit 28318d0839
2 changed files with 3 additions and 3 deletions

View File

@ -451,7 +451,7 @@ void GnapEngine::updateCursorByHotspot() {
if (_debugger->_showHotspotNumber) {
// NOTE This causes some display glitches
char t[256];
sprintf(t, "hotspot = %2d", hotspotIndex);
Common::sprintf_s(t, "hotspot = %2d", hotspotIndex);
if (!_font)
_gameSys->fillSurface(nullptr, 10, 10, 80, 16, 0, 0, 0);
else

View File

@ -658,7 +658,7 @@ bool Scene50::updateCountdown() {
void Scene50::drawCountdown(int value) {
char str[8];
sprintf(str, "%02d", value);
Common::sprintf_s(str, "%02d", value);
_vm->_gameSys->fillSurface(nullptr, 371, 505, 50, 27, 0, 0, 0);
_vm->_gameSys->drawTextToSurface(nullptr, 381, 504, 255, 255, 255, str);
}
@ -2636,7 +2636,7 @@ void Scene52::initAnims() {
void Scene52::drawScore(int score) {
char str[4];
sprintf(str, "%03d", score);
Common::sprintf_s(str, "%03d", score);
_vm->_gameSys->fillSurface(nullptr, 420, 80, 48, 30, 0, 0, 0);
_vm->_gameSys->drawTextToSurface(nullptr, 420, 80, 255, 255, 255, str);
}