Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/yhoogstrate/fastafs
Browse files Browse the repository at this point in the history
  • Loading branch information
yhoogstrate committed Jan 20, 2022
2 parents 96f0e59 + 8ecb337 commit 8c26870
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,12 @@ void database::list()
fastafs f = fastafs(line);
f.load(fname);

std::ifstream file(fname, std::ios::in | std::ios::binary | std::ios::ate);
uint32_t size = (uint32_t) file.tellg();
file.close();
uint32_t size;
{
std::ifstream file(fname, std::ios::in | std::ios::binary | std::ios::ate);
size = (uint32_t) file.tellg();
file.close();
}


std::string mountpoints = "-";
Expand Down Expand Up @@ -136,7 +139,7 @@ std::string database::get(std::string fastafs_name_or_id)
std::ifstream infile(this->idx);
std::string line;

while(std::getline(infile, line)) {
while(std::getline(infile, line, '\n')) {
if(line.compare(fastafs_name_or_id) == 0) {
fname = this->path + "/" + line + ".fastafs";

Expand Down

0 comments on commit 8c26870

Please sign in to comment.