Re: [GSoC][PATCH v14 03/11] fsck: add a unified interface for reporting fsck messages
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Aug 5, 2024, 12:58 UTC
- Message-ID
- <ZrDMXgEuE8yeSzkw@tanuki>
- In-Reply-To
- <ZqumN5cfsQYHlU5X@ArchLinux>
On Thu, Aug 01, 2024 at 11:13:59PM +0800, shejialuo wrote:
Show 8 quoted lines
> @@ -254,9 +251,9 @@ static int report(struct fsck_options *options, > prepare_msg_ids(); > strbuf_addf(&sb, "%s: ", msg_id_info[msg_id].camelcased); > > - va_start(ap, fmt); > - strbuf_vaddf(&sb, fmt, ap); > - result = options->error_func(options, &report, > + va_copy(ap_copy, ap);
Can't we use `ap` directly instead of copying it? We'd have to get rid of the call to `va_end` as our caller already does that, but other than that I don't see any reason to copy the argument list here.
Show 5 quoted lines
> + strbuf_vaddf(&sb, fmt, ap_copy); > + result = options->error_func(options, fsck_report, > msg_type, msg_id, sb.buf); > strbuf_release(&sb); > va_end(ap);
Patrick