Page 1 of 1

get_self_executable() returns address of local variable

Posted: Sun Jun 13, 2010 9:14 am
by Lorsch

Yesterday I downloaded t-engine4-src-1.0.0beta3 from In src/getself.c I found

Code: Select all

const char *get_self_executable(int argc, char **argv)
        char res[PATH_MAX];
        return res;
The storage class of res should probably be static.