On Mon, Aug 05, 2024 at 02:58:06PM +0200, Patrick Steinhardt wrote: > On Thu, Aug 01, 2024 at 11:13:59PM +0800, shejialuo wrote: > > @@ -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. > Thanks, Patrick! This is right. I will fix this in the next version. > > + 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