mirror of https://github.com/YosysHQ/abc.git
Use <limits.h>'s PATH_MAX macro instead of fixed size.
Signed-off-by: Mike Inouye <mikeinouye@google.com>
This commit is contained in:
parent
db735b632f
commit
ee5acbbc01
|
|
@ -18,6 +18,8 @@
|
||||||
|
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
|
#include <limits.h>
|
||||||
|
|
||||||
#include "extra.h"
|
#include "extra.h"
|
||||||
|
|
||||||
ABC_NAMESPACE_IMPL_START
|
ABC_NAMESPACE_IMPL_START
|
||||||
|
|
@ -184,9 +186,9 @@ char * Extra_FileNameGeneric( char * FileName )
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
char * Extra_FileNameGenericAppend( char * pBase, char * pSuffix )
|
char * Extra_FileNameGenericAppend( char * pBase, char * pSuffix )
|
||||||
{
|
{
|
||||||
static char Buffer[2000];
|
static char Buffer[PATH_MAX];
|
||||||
char * pDot;
|
char * pDot;
|
||||||
assert( strlen(pBase) + strlen(pSuffix) < 2000 );
|
assert( strlen(pBase) + strlen(pSuffix) < PATH_MAX );
|
||||||
strcpy( Buffer, pBase );
|
strcpy( Buffer, pBase );
|
||||||
if ( (pDot = strrchr( Buffer, '.' )) )
|
if ( (pDot = strrchr( Buffer, '.' )) )
|
||||||
*pDot = 0;
|
*pDot = 0;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue