Bug fix for stack overrun in lua-engine on mac OSX.
This commit is contained in:
parent
5c992a8610
commit
21291430b4
|
@ -559,7 +559,7 @@ static int emu_getdir(lua_State *L) {
|
||||||
return 1;
|
return 1;
|
||||||
#elif __linux__
|
#elif __linux__
|
||||||
char exePath[ 2048 ];
|
char exePath[ 2048 ];
|
||||||
ssize_t count = ::readlink( "/proc/self/exe", exePath, sizeof(exePath)-1 );
|
ssize_t count = ::readlink( "/proc/self/exe", exePath, sizeof(exePath)-1 );
|
||||||
|
|
||||||
if ( count > 0 )
|
if ( count > 0 )
|
||||||
{
|
{
|
||||||
|
@ -584,7 +584,7 @@ static int emu_getdir(lua_State *L) {
|
||||||
if ( result == 0 )
|
if ( result == 0 )
|
||||||
{
|
{
|
||||||
char *dir;
|
char *dir;
|
||||||
exePath[ bufSize ] = 0;
|
exePath[ sizeof(exePath)-1 ] = 0;
|
||||||
//printf("EXE Path: '%s' \n", exePath );
|
//printf("EXE Path: '%s' \n", exePath );
|
||||||
|
|
||||||
dir = ::dirname( exePath );
|
dir = ::dirname( exePath );
|
||||||
|
|
Loading…
Reference in New Issue