Browse Source

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

master
kevin 7 years ago
parent
commit
1a042843c8
1 changed files with 12 additions and 2 deletions
  1. 12
    2
      app/cmXScore.c

+ 12
- 2
app/cmXScore.c View File

@@ -1376,8 +1376,18 @@ void  _cmXScoreSetMeasGroups( cmXScore_t* p, unsigned flag )
1376 1376
           }
1377 1377
 
1378 1378
           if( cmIsFlag(np->flags,kSectionXsFl) )
1379
-            sectionId = np->tvalue==NULL ? 0 : strtol(np->tvalue,NULL,10);
1380
-
1379
+          {
1380
+            sectionId = 0;
1381
+            
1382
+            if( np->tvalue == NULL )
1383
+              cmErrWarnMsg(&p->err,kSyntaxErrorXsRC,"An apparent section label in measure '%i' is blank.",np->meas->number);            
1384
+            else
1385
+            if( cmTextToUInt( np->tvalue, &sectionId, NULL ) != kOkTxRC )
1386
+              cmErrWarnMsg(&p->err,kSyntaxErrorXsRC,"The section label '%s' is not an integer.",np->tvalue);
1387
+                
1388
+                //sectionId = np->tvalue==NULL ? 0 : strtol(np->tvalue,NULL,10);
1389
+          }
1390
+          
1381 1391
           n0       = NULL;
1382 1392
         }
1383 1393
       }

Loading…
Cancel
Save