Free the string returned by SDL_GetBasePath
Thanks, Fayti1703.
This commit is contained in:
parent
2d73fd8bb9
commit
0b874153d4
1 changed files with 3 additions and 1 deletions
|
@ -94,7 +94,9 @@ int GetFramePerSecound()
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
// Get executable's path
|
// Get executable's path
|
||||||
strcpy(gModulePath, SDL_GetBasePath());
|
char *base_path = SDL_GetBasePath();
|
||||||
|
strcpy(gModulePath, base_path);
|
||||||
|
SDL_free(base_path);
|
||||||
if (gModulePath[strlen(gModulePath) - 1] == '/' || gModulePath[strlen(gModulePath) - 1] == '\\')
|
if (gModulePath[strlen(gModulePath) - 1] == '/' || gModulePath[strlen(gModulePath) - 1] == '\\')
|
||||||
gModulePath[strlen(gModulePath) - 1] = '\0'; // String cannot end in slash or stuff will probably break (original does this through a windows.h provided function)
|
gModulePath[strlen(gModulePath) - 1] = '\0'; // String cannot end in slash or stuff will probably break (original does this through a windows.h provided function)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue