Provide more informative error message when encountering unexpected n…#689
Provide more informative error message when encountering unexpected n…#689cinquin wants to merge 1 commit intosamtools:developfrom
Conversation
…ewline character in SAM header.
|
This could print lots of lines if the problem happens at the start of a long header. There's also no way of limiting the output if the header doesn't include a terminating NUL character, which could be a security problem. It would be best to keep track of the start of the last line so that the dump always begins at a sensible place. Then use memchr() to find out where the current line ends and use an output format of the form |
|
It's also incorrect to say "unexpected newline" because this error will be triggered on a header that has zero newlines (and also doesn't start with an @). Not that we can (legally) create such things, but the whole point of this is to spot illegal / corrupted data. |
…ewline character in SAM header.