Re: [PATCH 2/3] stripspace: Implement --count-lines option
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 16, 2015, 17:35 UTC
- Message-ID
- <xmqq8u72g1hm.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20151016075134.GM11304@distanz.ch>
Tobias Klauser <tklauser@distanz.ch> writes:
>> So this is your output code, which gives only the number of lines
>> without the cleaned up result.
>
> This should better be a simple printf("%zu\n", lines) I guess?I think we actively avoid using %z conversion that is only C99.
If you really want to, you could count in size_t and use %lu with appropriate casting, which I think is what we do in the rest of the codebase.
For this one, I think it is sufficient to just count in int and print as int with %d, though.