From 1e53a78a99d3c002363a8300aba46531baa0f3c5 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Fri, 31 Aug 2012 15:14:30 -0700 Subject: Bug fix in the old Liberty parser. --- src/map/amap/amapLiberty.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/map/amap/amapLiberty.c') 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; -- cgit v1.2.3