- Timestamp:
- 06/23/16 00:09:06 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/genetics/geno.cpp
r518 r521 34 34 if (genstring.charAt(0) == '/') 35 35 { 36 int end ;36 int end, error_end=-1; 37 37 switch (genstring.charAt(1)) 38 38 { 39 39 case '/': 40 40 genformat = genstring.charAt(2); 41 if ((genformat=='\0')|| (genformat=='\n'))41 if ((genformat=='\0')||isspace(genformat)) 42 42 genformat=INVALID_FORMAT; 43 43 if ((end = genstring.indexOf('\n')) >= 0) 44 44 { 45 error_end=end; 45 46 if (end!=3) genformat=INVALID_FORMAT; 46 47 gencopy = genstring.substr(end + 1); … … 56 57 case '*': 57 58 genformat = genstring.charAt(2); 58 if ((genformat=='\0')|| (genformat=='\n'))59 if ((genformat=='\0')||isspace(genformat)) 59 60 genformat=INVALID_FORMAT; 60 61 if ((end = genstring.indexOf("*/")) >= 0) 61 62 { 63 error_end=end+2; 62 64 if (end!=3) genformat=INVALID_FORMAT; 63 65 gencopy = genstring.substr(end + 2); … … 72 74 break; 73 75 } 76 if (genformat==INVALID_FORMAT) 77 { 78 SString cut; 79 if (error_end<0) error_end=genstring.len(); 80 static const int MAX_ERROR=20; 81 if (error_end>MAX_ERROR) 82 cut=genstring.substr(0,MAX_ERROR)+"..."; 83 else 84 cut=genstring.substr(0,error_end); 85 int lf=cut.indexOf('\n'); 86 if (lf>=0) cut=cut.substr(0,lf); 87 logPrintf("Geno","init",LOG_ERROR,"Invalid genotype format declaration: '%s'%s",cut.c_str(),genname.len()?SString::sprintf(" in '%s'",genname.c_str()).c_str():""); 88 } 89 74 90 } 75 91 } … … 274 290 } 275 291 isvalid = 0; 276 logPrintf("Geno", "validate", LOG_WARN, "Wrong configuration? No genotype validators defined for genetic format f%c.", format);292 logPrintf("Geno", "validate", LOG_WARN, "Wrong configuration? No genotype validators defined for genetic format 'f%c'.", format); 277 293 } 278 294
Note: See TracChangeset
for help on using the changeset viewer.