Bläddra i källkod

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

master
kevin 7 år sedan
förälder
incheckning
1a042843c8
1 ändrade filer med 12 tillägg och 2 borttagningar
  1. 12
    2
      app/cmXScore.c

+ 12
- 2
app/cmXScore.c Visa fil

1376
           }
1376
           }
1377
 
1377
 
1378
           if( cmIsFlag(np->flags,kSectionXsFl) )
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
           n0       = NULL;
1391
           n0       = NULL;
1382
         }
1392
         }
1383
       }
1393
       }

Laddar…
Avbryt
Spara