Skip to content

Commit

Permalink
Fixed multiset union output upon input of two or more Starch archives
Browse files Browse the repository at this point in the history
  • Loading branch information
alexpreynolds committed Jun 18, 2017
1 parent 42ed6f5 commit 6ee04d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions docs/content/revision-history.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ This build of BEDOPS includes significant performance improvements. Tests were p
* :ref:`starch <starch>`

* Fixed potential segmentation fault with `--header` usage.

* :ref: Starch C++ API

* Fixed output from `bedops -u` (multiset union) on two or more Starch archives, such that the remainder string was not being cleared correctly.

=================
Previous versions
Expand Down
6 changes: 4 additions & 2 deletions interfaces/general-headers/data/starch/starchApi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1787,6 +1787,8 @@ namespace starch
else
std::sprintf(out, "%s\t%" PRId64 "\t%" PRId64, _currChr, _currStart, _currStop);
line = out;
_currRemainder[0] = '\0';
_currRemainderLen = 0;

if (archType == kGzip)
postBreakdownZValuesIdentical = (zOutBufIdx == zHave);
Expand Down Expand Up @@ -1896,14 +1898,14 @@ namespace starch
needToInflateZChunk = false;
}

/* read through zOutBuf for newlines */
/* read through zOutBuf for newlines */
for (; zOutBufIdx < zHave; zBufIdx++) {
if (zOutBuf[zOutBufIdx++] == '\n') {
zLineBuf[zBufIdx] = '\0';
zBufIdx = 0;
#ifdef DEBUG
std::fprintf(stderr, "\n--> full line [ %s ]\n", zLineBuf);
#endif
#endif
return EXIT_SUCCESS;
}
else {
Expand Down

0 comments on commit 6ee04d3

Please sign in to comment.