mirror of
https://bitbucket.org/theswgsource/src-1.2.git
synced 2026-07-14 00:01:30 -04:00
use PATH_MAX
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user