]> git.donarmstrong.com Git - mothur.git/blobdiff - formatphylip.cpp
fixing bugs while testing
[mothur.git] / formatphylip.cpp
index 60a3b4136810515bc628b334d948fb0d957605d2..0390a806f97c5397d046c1384c1b4356280e78d9 100644 (file)
@@ -24,7 +24,12 @@ int FormatPhylipMatrix::read(NameAssignment* nameMap){
                        string name;
                        ofstream out;
                        
-                       fileHandle >> nseqs >> name;
+                       string numTest;
+                       fileHandle >> numTest >> name;
+                       
+                       if (!m->isContainingOnlyDigits(numTest)) { m->mothurOut("[ERROR]: expected a number and got " + numTest + ", quitting."); m->mothurOutEndLine(); exit(1); }
+                       else { convert(numTest, nseqs); }
+               
                                                
                        list = new ListVector(nseqs);
                        list->set(0, name);