cmScore.c : Changes to _cmScProcSets() to prevent crashing on OSX debug build.

This commit is contained in:
kevin 2013-11-03 11:47:10 -08:00
parent 5fd0c95f34
commit a690102601

View File

@ -804,9 +804,19 @@ cmScRC_t _cmScProcSets( cmSc_t* p )
// THIS PRINTF PREVENTS CRASH ON OSX ??????? // THIS PRINTF PREVENTS CRASH ON OSX ???????
//printf("PROCSET:%i %c %s\n",p->sets[i].varId,_cmScVarIdToChar(p->sets[i].varId),ep->label); //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 else
{ {