ToME: the Tales of Maj'Eyal
http://forums.te4.org/

get_self_executable() returns address of local variable
http://forums.te4.org/viewtopic.php?f=42&t=21819
Page 1 of 1

Author:  Lorsch [ Sun Jun 13, 2010 9:14 am ]
Post subject:  get_self_executable() returns address of local variable

Hi,

Yesterday I downloaded t-engine4-src-1.0.0beta3 from http://tome.te4.org/download. In src/getself.c I found

Code:
const char *get_self_executable(int argc, char **argv)
{
        char res[PATH_MAX];
        ...
        return res;
}


The storage class of res should probably be static.

Lorsch

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/