Make sure MAX_OSPATH has sane size; fix some typos

This commit is contained in:
Daniel Gibson 2022-01-16 06:02:40 +01:00
parent d679e393c3
commit 4f74c15afe
3 changed files with 6 additions and 3 deletions

View file

@ -2592,7 +2592,7 @@ void idCommonLocal::Async( void ) {
=================
idCommonLocal::LoadGameDLLbyName
Helper for LoadGameDLL() to make it less painfull to try different dll names.
Helper for LoadGameDLL() to make it less painful to try different dll names.
=================
*/
void idCommonLocal::LoadGameDLLbyName( const char *dll, idStr& s ) {

View file

@ -61,7 +61,10 @@ If you have questions concerning this license or the applicable additional terms
// => change it (to -1?) or does that break anything?
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 {

View file

@ -40,7 +40,7 @@ If you have questions concerning this license or the applicable additional terms
===============================================================================
*/
// Win32
// AROS
#if defined(__AROS__)
#define _alloca alloca