Compare commits

...

1 commit

Author SHA1 Message Date
Phil Hofer
647ed1f016 reader: fix Skip(n) where n >= buffer size
The (*Reader).Skip() code did not handle skip sizes
above the buffer size correctly, because the inner
reader loop only looped while 'r.buffered() < n', and
that condition is obviously violated when the reader
successfully buffers more bytes than are to be skipped.

Refactor this method to be a little shorter and hopefully
much clearer (and more correct) and add test coverage that
exercises this code better.
2020-11-24 00:41:02 +00:00
2 changed files with 67 additions and 50 deletions