From a690102601e0d974780c902452c1137f3a1ae3f0 Mon Sep 17 00:00:00 2001 From: kevin Date: Sun, 3 Nov 2013 11:47:10 -0800 Subject: [PATCH] cmScore.c : Changes to _cmScProcSets() to prevent crashing on OSX debug build. --- app/cmScore.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/app/cmScore.c b/app/cmScore.c index b941c9d..b531a30 100644 --- a/app/cmScore.c +++ b/app/cmScore.c @@ -804,9 +804,19 @@ cmScRC_t _cmScProcSets( cmSc_t* p ) // THIS PRINTF PREVENTS CRASH ON OSX ??????? //printf("PROCSET:%i %c %s\n",p->sets[i].varId,_cmScVarIdToChar(p->sets[i].varId),ep->label); + char cc = _cmScVarIdToChar(p->sets[i].varId); + int nn = snprintf(NULL,0,"%c-%s",cc,ep->label); + char b[nn+2]; + snprintf(b,nn,"%c-%s",cc,ep->label); + p->sets[i].symArray[j] = cmSymTblRegisterSymbol(p->stH,b); + snprintf(b,nn+1,"c%c-%s",cc,ep->label); + p->sets[i].costSymArray[j] = cmSymTblRegisterSymbol(p->stH,b); + + + //p->sets[i].symArray[j] = cmSymTblRegisterFmt(p->stH,"%c-%s", cc,ep->label); + //p->sets[i].costSymArray[j] = cmSymTblRegisterFmt(p->stH,"c%c-%s",cc,ep->label); + - p->sets[i].symArray[j] = cmSymTblRegisterFmt(p->stH,"%c-%s", _cmScVarIdToChar(p->sets[i].varId),ep->label); - p->sets[i].costSymArray[j] = cmSymTblRegisterFmt(p->stH,"c%c-%s",_cmScVarIdToChar(p->sets[i].varId),ep->label); } else {