if(str[0] == 's' && str[1] == 'e' && str[2] == '[')
{
// Reading in the decay channels
- char *tLBrackert, *tFirstComma, *tSecondComma, *tThirdComma, *tRBracket;
+ char *tLBrackert=NULL, *tFirstComma=NULL, *tSecondComma=NULL, *tThirdComma=NULL, *tRBracket=NULL;
tLBrackert = strchr(str,'[');
tFirstComma = strchr(str,',');
+ if (!tFirstComma) exit(0);
tSecondComma = strchr(tFirstComma+1,',');
+ if (!tSecondComma) exit(0);
tThirdComma = strchr(tSecondComma+1,',');
+ if (!tThirdComma) exit(0);
tRBracket = strchr(tThirdComma,']');
- if (!(tLBrackert && tFirstComma && tSecondComma && tThirdComma && tRBracket))
+ if (!((tLBrackert != NULL) && (tFirstComma != NULL) && (tSecondComma != NULL) && ( tThirdComma != NULL) && (tRBracket!= NULL))) {
PRINT_DEBUG_1("Malformed line!: " << str);
-
+ exit(0);
+ }
+
char *tFather = new char[tFirstComma-tLBrackert];
strncpy(tFather, tLBrackert+1, tFirstComma-tLBrackert-1);
char *tDaughter1 = new char[tSecondComma-tFirstComma];
char *tLBrackert, *tFirstComma, *tSecondComma, *tThirdComma, *tRBracket;
tLBrackert = strchr(str,'[');
+ if (!tLBrackert) exit(0);
tFirstComma = strchr(str,',');
+ if (!tFirstComma) exit(0);
tSecondComma = strchr(tFirstComma+1,',');
+ if (!tSecondComma) exit(0);
tThirdComma = strchr(tSecondComma+1,',');
+ if (!tThirdComma) exit(0);
tRBracket = strchr(tThirdComma,']');
if (!(tLBrackert && tFirstComma && tSecondComma && tThirdComma && tRBracket))
PRINT_DEBUG_1("Malformed line!: " << str);