Use <limits.h>'s PATH_MAX macro instead of fixed size.

Signed-off-by: Mike Inouye <mikeinouye@google.com>
This commit is contained in:
Mike Inouye 2024-09-18 23:05:32 +00:00
parent db735b632f
commit ee5acbbc01
1 changed files with 4 additions and 2 deletions

View File

@ -18,6 +18,8 @@
***********************************************************************/
#include <limits.h>
#include "extra.h"
ABC_NAMESPACE_IMPL_START
@ -184,9 +186,9 @@ char * Extra_FileNameGeneric( char * FileName )
***********************************************************************/
char * Extra_FileNameGenericAppend( char * pBase, char * pSuffix )
{
static char Buffer[2000];
static char Buffer[PATH_MAX];
char * pDot;
assert( strlen(pBase) + strlen(pSuffix) < 2000 );
assert( strlen(pBase) + strlen(pSuffix) < PATH_MAX );
strcpy( Buffer, pBase );
if ( (pDot = strrchr( Buffer, '.' )) )
*pDot = 0;