Re: [PATCH 2/5] http: use `size_t` for byte position in fwrite_sha1_file
- From
Simon Richter <simon.richter@hogyros.de>
- Date
- Oct 17, 2026, 00:18 UTC
- Message-ID
- <395b47c0-6dc7-4a1b-b547-e5e68e7356f5@hogyros.de>
- In-Reply-To
- <xmqq1p9pk99q.fsf@gitster.g>
Hi,
On 10/16/26 23:30, Junio C Hamano wrote:
> I agree that changing the type of posn from int to size_t is the > right move.
It is a position in a file that is being read as binary data[1], so off_t would be the best choice I think.
That is still signed, but it can't overflow, because opening large files requires O_LARGEFILE, which is available only if large file support is enabled, which conveniently makes sure that off_t is 64 bit.
Simon
[1] to make a distinction from the use case for fpos_t