X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=mothur.h;h=d5086b3909ece580bbb552454ced3a742b790dcd;hb=d84bb41d7dadcfa2c67ce5edb9b94060e5659fa7;hp=2622e2515e87ed9914f4491b716dc03c501d5411;hpb=b45e6f3d505a212cebad5ca22e2611b1466bca48;p=mothur.git diff --git a/mothur.h b/mothur.h index 2622e25..d5086b3 100644 --- a/mothur.h +++ b/mothur.h @@ -1163,7 +1163,7 @@ inline vector 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 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();