From: Jeff King Date: Wed, 13 Sep 2017 18:11:27 GMT Subject: Re: [PATCH 1/7] config: avoid "write_in_full(fd, buf, len) < len" pattern Message-ID: <20170913181127.rl2kfqkw7basp6kb@sigill.intra.peff.net> In-Reply-To: <20170913175930.GD27425@aiede.mtv.corp.google.com> On Wed, Sep 13, 2017 at 10:59:30AM -0700, Jonathan Nieder wrote: > I can confidentally say the intent in C99 in that passage is to > describe the type of the expression, not just the type of a variable > that can hold it. Doh. The problem is that I'm a moron. The copy_begin and copy_end values are _not_ pointers, they're size_t. That's why we have to use: contents + copy_begin as the buffer. So there is no ptrdiff_t involved at all, just a size_t. -Peff