]> git.donarmstrong.com Git - mothur.git/blobdiff - mothur.h
filter.seqs bug change
[mothur.git] / mothur.h
index 2622e2515e87ed9914f4491b716dc03c501d5411..d5086b3909ece580bbb552454ced3a742b790dcd 100644 (file)
--- a/mothur.h
+++ b/mothur.h
@@ -1163,7 +1163,7 @@ inline vector<unsigned long int> divideFile(string filename, int& proc) {
                //for each process seekg to closest file break and search for next '>' char. make that the filebreak
                for (int i = 0; i < proc; i++) {
                        unsigned long int spot = (i+1) * chunkSize;
-                       
+                                       
                        ifstream in;
                        openInputFile(filename, in);
                        in.seekg(spot);
@@ -1174,9 +1174,10 @@ inline vector<unsigned long int> divideFile(string filename, int& proc) {
                           char c = in.get();
                           if (c == '>') {   in.putback(c); newSpot = in.tellg(); break;  }
                        }
-                       
+                               
                        //there was not another sequence before the end of the file
-                       if (newSpot == spot) {  break;  }
+                       unsigned long int sanityPos = in.tellg();
+                       if (sanityPos == -1) {  break;  }
                        else {   filePos.push_back(newSpot);  }
                        
                        in.close();