mirror of
https://github.com/dhewm/dhewm3-sdk.git
synced 2024-11-23 21:12:19 +00:00
Make sure MAX_OSPATH has sane size
This commit is contained in:
parent
a09487b720
commit
4b1369e859
1 changed files with 4 additions and 1 deletions
|
@ -59,7 +59,10 @@ If you have questions concerning this license or the applicable additional terms
|
|||
|
||||
static const ID_TIME_T FILE_NOT_FOUND_TIMESTAMP = 0xFFFFFFFF;
|
||||
static const int MAX_PURE_PAKS = 128;
|
||||
static const int MAX_OSPATH = FILENAME_MAX;
|
||||
// DG: https://www.gnu.org/software/libc/manual/html_node/Limits-for-Files.html says
|
||||
// that FILENAME_MAX can be *really* big on some systems and thus is not suitable
|
||||
// for buffer lengths. So limit it to prevent stack overflow/out of memory issues
|
||||
static const int MAX_OSPATH = (FILENAME_MAX < 32000) ? FILENAME_MAX : 32000;
|
||||
|
||||
// modes for OpenFileByMode. used as bit mask internally
|
||||
typedef enum {
|
||||
|
|
Loading…
Reference in a new issue