All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Patrick Steinhardt <ps@pks.im>
Cc: 20250126125638.3089-1-soekkle@freenet.de, git@vger.kernel.org,
	phillip.wood123@gmail.com, sunshine@sunshineco.com,
	"Sören Krecker" <soekkle@freenet.de>
Subject: Re: [PATCH v3 2/4] date.c: Fix type conversation warnings from msvc
Date: Mon, 27 Jan 2025 08:15:17 -0800	[thread overview]
Message-ID: <xmqqwmegutbe.fsf@gitster.g> (raw)
In-Reply-To: <Z5c1F7oqsaPrHRiT@pks.im> (Patrick Steinhardt's message of "Mon, 27 Jan 2025 08:26:15 +0100")

Patrick Steinhardt <ps@pks.im> writes:

>> diff --git a/date.c b/date.c
>> index a1b26a8dce..0a3fafc8a4 100644
>> --- a/date.c
>> +++ b/date.c
>> @@ -1270,8 +1270,8 @@ static const char *approxidate_alpha(const char *date, struct tm *tm, struct tm
>>  
>>  	tl = typelen;
>>  	while (tl->type) {
>> -		int len = strlen(tl->type);
>> -		if (match_string(date, tl->type) >= len-1) {
>> +		size_t len = strlen(tl->type);
>> +		if (match_string(date, tl->type)+1 >= len) {
>
> Formatting is off here, there should be spaces around `+`, even though
> you simply followed previous style. It would be nice to point out why
> this change is makde in the commit message.

I think len-1 here is perfectly fine, as there is no element in
typelen[] whose .type member is an empty string, and no need to
touch that.

Besides, we already have this one in 'next'.

Thanks.


  reply	other threads:[~2025-01-27 16:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-26 12:58 [PATCH v3 2/4] date.c: Fix type conversation warnings from msvc Sören Krecker
2025-01-27  7:26 ` Patrick Steinhardt
2025-01-27 16:15   ` Junio C Hamano [this message]
2025-01-28  8:45     ` Patrick Steinhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqwmegutbe.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=20250126125638.3089-1-soekkle@freenet.de \
    --cc=git@vger.kernel.org \
    --cc=phillip.wood123@gmail.com \
    --cc=ps@pks.im \
    --cc=soekkle@freenet.de \
    --cc=sunshine@sunshineco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.