-
Notifications
You must be signed in to change notification settings - Fork 446
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cap hts_getline() return value at INT_MAX
On success, hts_getline() returns the length of the string read. Its return type is int, so when plain int is 32 bits, trouble ensues for very long lines exceeding 2GiB: the return value wraps to negative and is misinterpreted as error. Rather than changing the return type to e.g. ssize_t, clamp the return value for very long lines. In test/sam.c's test cases, check the return value is indeed the expected length.
- Loading branch information
Showing
3 changed files
with
7 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters