#ifndef _WIN32
char Cwd[MAXPATHLEN];
- char *Buf, *PathEnv, *Directory, PathTest[MAXPATHLEN], FullExePath[MAXPATHLEN];
+ char *PathEnv, *Directory, PathTest[MAXPATHLEN], FullExePath[MAXPATHLEN];
bool FoundPath;
const char *argv0 = m_Arguments[0].c_str();
}
}
- if ((Buf = realpath(FullExePath, NULL)) == NULL)
+ char Buf[PATH_MAX];
+ if (realpath(FullExePath, Buf) == NULL)
throw PosixException("realpath failed", errno);
// remove filename
*LastSlash = '\0';
ExePath = string(Buf);
-
- free(Buf);
#else /* _WIN32 */
char FullExePath[MAXPATHLEN];