mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-23 06:10:03 -06:00
make it even saferer
This commit is contained in:
@ -1575,6 +1575,8 @@ int main(int argc, char** argv)
|
|||||||
if (argv[0][len] == '\\') break;
|
if (argv[0][len] == '\\') break;
|
||||||
len--;
|
len--;
|
||||||
}
|
}
|
||||||
|
if (len > 0)
|
||||||
|
{
|
||||||
EmuDirectory = new char[len];
|
EmuDirectory = new char[len];
|
||||||
strncpy(EmuDirectory, argv[0], len);
|
strncpy(EmuDirectory, argv[0], len);
|
||||||
EmuDirectory[len] = '\0';
|
EmuDirectory[len] = '\0';
|
||||||
@ -1584,6 +1586,12 @@ int main(int argc, char** argv)
|
|||||||
EmuDirectory = new char[2];
|
EmuDirectory = new char[2];
|
||||||
strcpy(EmuDirectory, ".");
|
strcpy(EmuDirectory, ".");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
EmuDirectory = new char[2];
|
||||||
|
strcpy(EmuDirectory, ".");
|
||||||
|
}
|
||||||
|
|
||||||
// http://stackoverflow.com/questions/14543333/joystick-wont-work-using-sdl
|
// http://stackoverflow.com/questions/14543333/joystick-wont-work-using-sdl
|
||||||
SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1");
|
SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1");
|
||||||
|
Reference in New Issue
Block a user