Skip to content

Commit

Permalink
Terminate unpadded sequences with \n\0
Browse files Browse the repository at this point in the history
  • Loading branch information
milot-mirdita committed Jan 7, 2025
1 parent e6f0328 commit 6e46b5e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/commons/DBReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ template <typename T> bool DBReader<T>::open(int accessType){
dstream = new ZSTD_DStream*[threads];
for(int i = 0; i < threads; i++){
// allocated buffer
compressedBufferSizes[i] = std::max(maxSeqLen+1, 1024u);
compressedBufferSizes[i] = std::max(maxSeqLen+2, 1024u);
compressedBuffers[i] = (char*) malloc(compressedBufferSizes[i]);
incrementMemory(compressedBufferSizes[i]);
if(compressedBuffers[i]==NULL){
Expand Down Expand Up @@ -552,6 +552,8 @@ template <typename T> char* DBReader<T>::getUnpadded(size_t id, int thrIdx) {
unsigned char baseCode = (code >= 32) ? code - 32 : code;
compressedBuffers[thrIdx][i] = CODE_TO_CHAR[baseCode];
}
compressedBuffers[thrIdx][seqLen + 0] = '\n';
compressedBuffers[thrIdx][seqLen + 1] = '\0';
return compressedBuffers[thrIdx];
}

Expand Down

0 comments on commit 6e46b5e

Please sign in to comment.