Re: [PATCH 1/3] version: refactor strbuf_sanitize()
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Jun 19, 2024, 18:40 UTC
- Message-ID
- <CAPig+cT4PUUH5XCvmioYA-M=bOTed5jM08MpruScOZyvk8VVnw@mail.gmail.com>
- In-Reply-To
- <20240619125708.3719150-2-christian.couder@gmail.com>
On Wed, Jun 19, 2024 at 8:57 AM Christian Couder <christian.couder@gmail.com> wrote:
Show 15 quoted lines
> The git_user_agent_sanitized() function performs some sanitizing to > avoid special characters being sent over the line and possibly messing > up with the protocol or with the parsing on the other side. > > Let's extract this sanitizing into a new strbuf_sanitize() function, as > we will want to reuse it in a following patch. > > For now the new strbuf_sanitize() function is still static as it's only > needed locally. > > While at it, let's also make a few small improvements: > - use 'size_t' for 'i' instead of 'int', > - move the declaration of 'i' inside the 'for ( ... )', > - use strbuf_detach() to explicitely detach the string contained by > the 'buf' strbuf.
s/explicitely/explicitly/
> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>