From: Junio C Hamano Date: Wed, 22 Apr 2020 23:02:13 GMT Subject: Re: [PATCH 2/3] credential: teach `credential_from_url()` a non-strict mode Message-ID: In-Reply-To: Johannes Schindelin writes: > It is not obvious from the diff: `url` is never changed. It would still > point at the first `h`, as you said. > >> > + if (slash - url > 0) >> > + c->host = url_decode_mem(host, slash - host); > ... > I guess a better condition would be `if (proto_end || slash - host > 0)`. Yeah, that would probably be more intuitive to read. What triggered my reaction was the mismatch between "slash - url" in the condition and "slash - host" that specifies the length of the memory region.