mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-05 00:36:57 +00:00
Fix heap corruption. Fix compiler warning.
svn-id: r4901
This commit is contained in:
parent
5b4f2cefef
commit
0069fb1072
@ -548,8 +548,10 @@ int GameDetector::detectMain(int argc, char **argv)
|
||||
&& _gameDataPath[strlen(_gameDataPath)-1] != '\\') {
|
||||
char slashless[1024]; /* Append slash to path */
|
||||
strcpy(slashless, _gameDataPath);
|
||||
_gameDataPath = (char *)malloc((strlen(slashless) + 1) * sizeof(char));
|
||||
sprintf(_gameDataPath, "%s/", slashless);
|
||||
|
||||
// need to allocate 2 extra bytes, one for the "/" and one for the NULL terminator
|
||||
_gameDataPath = (char *)malloc((strlen(slashless) + 2) * sizeof(char));
|
||||
snprintf(_gameDataPath, strlen(_gameDataPath), "%s/", slashless);
|
||||
}
|
||||
|
||||
if (_amiga)
|
||||
|
@ -34,6 +34,7 @@ const bool true(1), false(0);
|
||||
//#pragma warning (disable: 4101)
|
||||
|
||||
#define scumm_stricmp stricmp
|
||||
#define snprintf _snprintf
|
||||
|
||||
#if defined(CHECK_HEAP)
|
||||
#undef CHECK_HEAP
|
||||
|
@ -2973,7 +2973,7 @@ void Scumm::o6_kernelFunction()
|
||||
push(a->frame);
|
||||
break;
|
||||
case 215:
|
||||
if (_extraBoxFlags[args[1]] & 0x00FF == 0x00C0) {
|
||||
if ((_extraBoxFlags[args[1]] & 0x00FF) == 0x00C0) {
|
||||
push(_extraBoxFlags[args[1]]);
|
||||
} else {
|
||||
byte *temp = (byte *)getBoxBaseAddr(args[1]);
|
||||
|
Loading…
Reference in New Issue
Block a user