Re: [PATCH v2 5/7] trace2: remove use of xstrfmt()
- From
Derrick Stolee <stolee@gmail.com>
- Date
- Aug 31, 2026, 12:51 UTC
- Message-ID
- <feddbfb8-9b1d-4bfd-980a-9d51e05ee0ee@gmail.com>
- In-Reply-To
- <xmqqy0dtket5.fsf@gitster.g>
On 8/25/2026 6:36 PM, Junio C Hamano wrote:
Show 16 quoted lines
> Elijah Newren <newren@gmail.com> writes: > >> On Tue, Aug 25, 2026 at 11:59 AM Derrick Stolee via GitGitGadget >> <gitgitgadget@gmail.com> wrote: >>> >> [...] >>> + const char *redact = ":<REDACTED>"; >>> + char *redacted; >> [...] >>> + memcpy(redacted, arg, prefix_len); >>> + memcpy(redacted + prefix_len, redact, redact_len - 1); >> >> Only copy redact_len - 1 bytes? So only ":<REDACTED" without the >> trailing ">" ? Why? > > Yeah, if it were (redact_len + 1) it would have worked better, perhaps?
I should have been more careful and realized that we don't have any tests that cover this logic.
We have tests for ":<redacted>" in pkt-line output, but not for the trace2 version.
Thanks, -Stolee