mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-27 05:32:45 +00:00
CGE: Don't use unsafe sprintf and vsprintf
This commit is contained in:
parent
ab0854d81a
commit
14e3d1f343
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user