CGE: Don't use unsafe sprintf and vsprintf

This commit is contained in:
Le Philousophe 2022-10-23 15:20:48 +02:00 committed by Eugene Sandulenko
parent ab0854d81a
commit 14e3d1f343
3 changed files with 5 additions and 5 deletions

View File

@ -547,7 +547,7 @@ void CGEEngine::setMapBrick(int x, int z) {
Square *s = new Square(this);
char n[6];
s->gotoxy(x * kMapGridX, kMapTop + z * kMapGridZ);
sprintf(n, "%02d:%02d", x, z);
Common::sprintf_s(n, "%02d:%02d", x, z);
_clusterMap[z][x] = 1;
s->setName(n);
_vga->_showQ->insert(s, _vga->_showQ->first());
@ -1448,7 +1448,7 @@ void CGEEngine::movie(const char *ext) {
return;
char fn[12];
sprintf(fn, "CGE.%s", (*ext == '.') ? ext +1 : ext);
Common::sprintf_s(fn, "CGE.%s", (*ext == '.') ? ext +1 : ext);
if (_resman->exist(fn)) {
loadScript(fn);

View File

@ -151,7 +151,7 @@ void Fx::preload(int ref0) {
char filename[12];
for (int ref = ref0; ref < ref0 + 10; ref++) {
sprintf(filename, "FX%05d.WAV", ref);
Common::sprintf_s(filename, "FX%05d.WAV", ref);
EncryptedStream file(_vm->_resman, filename);
DataCk *wav = loadWave(&file);
if (wav) {
@ -171,7 +171,7 @@ void Fx::preload(int ref0) {
DataCk *Fx::load(int idx, int ref) {
char filename[12];
sprintf(filename, "FX%05d.WAV", ref);
Common::sprintf_s(filename, "FX%05d.WAV", ref);
EncryptedStream file(_vm->_resman, filename);
DataCk *wav = loadWave(&file);

View File

@ -209,7 +209,7 @@ void Text::sayTime(Sprite *spr) {
_vm->_system->getTimeAndDate(curTime);
char t[6];
sprintf(t, "%d:%02d", curTime.tm_hour, curTime.tm_min);
Common::sprintf_s(t, "%d:%02d", curTime.tm_hour, curTime.tm_min);
say(t, spr);
}