cmXScore.c : Added error checking to section marker text-to-number conversion.

This commit is contained in:
kevin 2016-09-08 16:17:15 -04:00
parent 84c5097a8d
commit 1a042843c8

View File

@ -1376,7 +1376,17 @@ void _cmXScoreSetMeasGroups( cmXScore_t* p, unsigned flag )
} }
if( cmIsFlag(np->flags,kSectionXsFl) ) if( cmIsFlag(np->flags,kSectionXsFl) )
sectionId = np->tvalue==NULL ? 0 : strtol(np->tvalue,NULL,10); {
sectionId = 0;
if( np->tvalue == NULL )
cmErrWarnMsg(&p->err,kSyntaxErrorXsRC,"An apparent section label in measure '%i' is blank.",np->meas->number);
else
if( cmTextToUInt( np->tvalue, &sectionId, NULL ) != kOkTxRC )
cmErrWarnMsg(&p->err,kSyntaxErrorXsRC,"The section label '%s' is not an integer.",np->tvalue);
//sectionId = np->tvalue==NULL ? 0 : strtol(np->tvalue,NULL,10);
}
n0 = NULL; n0 = NULL;
} }