use PATH_MAX

This commit is contained in:
CodeCodon
2015-07-26 17:24:14 -05:00
parent e14a2c7b0f
commit ca7c8d7691
2 changed files with 7 additions and 1 deletions
@@ -349,8 +349,10 @@ bool Os::getAbsolutePath(const char *relativePath, char *absolutePath, int absol
{
// realpath sucks and could cause a buffer overrun. however, it's better than writing it ourselves for now.
char *result = realpath(relativePath, absolutePath);
if (!result)
if (!result){
free(result);
return false;
}
FATAL(istrlen(absolutePath)+1 > absolutePathBufferSize, ("buffer overrun"));
return true;
@@ -27,7 +27,11 @@ public:
enum
{
#ifdef PATH_MAX
MAX_PATH_LENGTH = PATH_MAX+1
#else
MAX_PATH_LENGTH = 512
#endif
};
typedef void (*QueueCharacterHookFunction)(int keyboard, int character);