Skip to content

Commit 65198f8

Browse files
2 parents b432b85 + 17d21f3 commit 65198f8

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

sam_record.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,10 @@ operator<<(std::ostream &the_stream, const sam_rec &r) {
108108
}
109109

110110
sam_rec::sam_rec(const string &line) {
111-
111+
/*
112112
istringstream iss; // ADS: change to set the buffer from "line"
113-
iss.rdbuf()->pubsetbuf(const_cast<char*>(line.c_str()), line.size());
113+
iss.rdbuf()->pubsetbuf(const_cast<char*>(line.c_str()), line.size());*/
114+
istringstream iss(line);
114115
uint32_t will_become_mapq = 0; // to not read mapq as character
115116
// since it's uint8_t
116117
if (!(iss >>

smithlab_os.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,11 @@ read_fasta_file_short_names(const string &filename,
390390
string line;
391391
while (getline(in, line)) {
392392
if (line[0] == '>') {
393-
names.push_back(string(begin(line) + 1,
393+
const auto first_space = line.find_first_of(" \t", 1);
394+
if (first_space == string::npos)
395+
names.push_back(line.substr(1));
396+
else
397+
names.push_back(string(begin(line) + 1,
394398
begin(line) + line.find_first_of(" \t", 1)));
395399
sequences.push_back(string());
396400
}

0 commit comments

Comments
 (0)