diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2012-08-31 15:14:30 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2012-08-31 15:14:30 -0700 |
commit | 1e53a78a99d3c002363a8300aba46531baa0f3c5 (patch) | |
tree | 064d7ba95f8279bc2988bf49e62369f55304313a /src/map | |
parent | 4bef56feb9ad83249e4254a541daf4aff274e450 (diff) | |
download | abc-1e53a78a99d3c002363a8300aba46531baa0f3c5.tar.gz abc-1e53a78a99d3c002363a8300aba46531baa0f3c5.tar.bz2 abc-1e53a78a99d3c002363a8300aba46531baa0f3c5.zip |
Bug fix in the old Liberty parser.
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/amap/amapLiberty.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/map/amap/amapLiberty.c b/src/map/amap/amapLiberty.c index bd554f8d..7e8a9af5 100644 --- a/src/map/amap/amapLiberty.c +++ b/src/map/amap/amapLiberty.c @@ -27,6 +27,8 @@ ABC_NAMESPACE_IMPL_START /// DECLARATIONS /// //////////////////////////////////////////////////////////////////////// +#define ABC_MAX_LIB_STR_LEN 5000 + // entry types typedef enum { AMAP_LIBERTY_NONE = 0, // 0: unknown @@ -310,8 +312,8 @@ int Amap_LibertyCellCountOutputs( Amap_Tree_t * p, Amap_Item_t * pCell ) ***********************************************************************/ char * Amap_LibertyGetString( Amap_Tree_t * p, Amap_Pair_t Pair ) { - static char Buffer[256]; - assert( Pair.End-Pair.Beg < 256 ); + static char Buffer[ABC_MAX_LIB_STR_LEN]; + assert( Pair.End-Pair.Beg < ABC_MAX_LIB_STR_LEN ); strncpy( Buffer, p->pContents+Pair.Beg, Pair.End-Pair.Beg ); Buffer[Pair.End-Pair.Beg] = 0; return Buffer; @@ -330,8 +332,8 @@ char * Amap_LibertyGetString( Amap_Tree_t * p, Amap_Pair_t Pair ) ***********************************************************************/ char * Amap_LibertyGetStringFormula( Amap_Tree_t * p, Amap_Pair_t Pair ) { - static char Buffer[256]; - assert( Pair.End-Pair.Beg-2 < 256 ); + static char Buffer[ABC_MAX_LIB_STR_LEN]; + assert( Pair.End-Pair.Beg-2 < ABC_MAX_LIB_STR_LEN ); strncpy( Buffer, p->pContents+Pair.Beg+1, Pair.End-Pair.Beg-2 ); Buffer[Pair.End-Pair.Beg-2] = 0; return Buffer; |