Skip to content
Discussion options

You must be logged in to vote

Yeah, what it is doing is advancing a buffer by Count number of bytes (unsigned machine word).

There's two cases:

  1. When the Count is the size or smaller than the size of the buffer. The result pointer is pointed at the start of the buffer when it was passed in. The buffer's length is advanced by Count number of 8-bit bytes. This effectively slices a segment, that is Count long, off the start of the buffer.
  2. When the Count is larger than the length of the buffer then the buffer is exhausted i.e. its length is set to 0 after advancing the buffer to its end. The result pointer is kept at 0 (pointing at nothing). This is intentional so that the caller knows that the advance could not return a …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by btgvesta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants