Fix heap corruption. Fix compiler warning.
svn-id: r4901
This commit is contained in:
parent
5b4f2cefef
commit
0069fb1072
3 changed files with 6 additions and 3 deletions
|
@ -548,8 +548,10 @@ int GameDetector::detectMain(int argc, char **argv)
|
||||||
&& _gameDataPath[strlen(_gameDataPath)-1] != '\\') {
|
&& _gameDataPath[strlen(_gameDataPath)-1] != '\\') {
|
||||||
char slashless[1024]; /* Append slash to path */
|
char slashless[1024]; /* Append slash to path */
|
||||||
strcpy(slashless, _gameDataPath);
|
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)
|
if (_amiga)
|
||||||
|
|
|
@ -34,6 +34,7 @@ const bool true(1), false(0);
|
||||||
//#pragma warning (disable: 4101)
|
//#pragma warning (disable: 4101)
|
||||||
|
|
||||||
#define scumm_stricmp stricmp
|
#define scumm_stricmp stricmp
|
||||||
|
#define snprintf _snprintf
|
||||||
|
|
||||||
#if defined(CHECK_HEAP)
|
#if defined(CHECK_HEAP)
|
||||||
#undef CHECK_HEAP
|
#undef CHECK_HEAP
|
||||||
|
|
|
@ -2973,7 +2973,7 @@ void Scumm::o6_kernelFunction()
|
||||||
push(a->frame);
|
push(a->frame);
|
||||||
break;
|
break;
|
||||||
case 215:
|
case 215:
|
||||||
if (_extraBoxFlags[args[1]] & 0x00FF == 0x00C0) {
|
if ((_extraBoxFlags[args[1]] & 0x00FF) == 0x00C0) {
|
||||||
push(_extraBoxFlags[args[1]]);
|
push(_extraBoxFlags[args[1]]);
|
||||||
} else {
|
} else {
|
||||||
byte *temp = (byte *)getBoxBaseAddr(args[1]);
|
byte *temp = (byte *)getBoxBaseAddr(args[1]);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue