Derek Martin wrote:
> This strikes me as wrong.  It depends on how the caller passes end...
> but this seems likely a fence post error to me (obviously I did not
> look--I would do so now but I need to step out, so I just have time to
> type this quick note).
> 
> If the string is size 4, and starts at address 0, then it occupies
> addresses 0-3.  3-0 - 3, not 4.
> 
> Obviously if end is the next character after the end of the string,
> this works as expected.  If that is the case it should be called out
> as such with a comment.

This is using the convention start <= i < end.  (Like Python slicing or
Ruby's "..." operator.)  write_one_header() is using the same convention
for its start and end values.

I agree it can initially be confusing, but it's used in several places
so I'm not sure it particularly merits a comment here.

-Kevin

Attachment: signature.asc
Description: PGP signature

Reply via email to