Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx> writes: > static const char *describe_object(struct object *obj) > { > - static struct strbuf buf = STRBUF_INIT; > - char *name = name_objects ? > - lookup_decoration(fsck_walk_options.object_names, obj) : NULL; > + static struct strbuf bufs[4] = { > + STRBUF_INIT, STRBUF_INIT, STRBUF_INIT, STRBUF_INIT > + }; If you need to repeat _INIT anyway, perhaps you want to actively omit the 4 from above, no? If you typed 6 by mistake instead, you'd be in trouble when using the last two elements. > static int objerror(struct object *obj, const char *err) > { > errors_found |= ERROR_OBJECT; > - objreport(obj, "error", err); > + fprintf_ln(stderr, "error in %s %s: %s", > + printable_type(obj), describe_object(obj), err); > return -1; > } Makes sense. > static int fsck_error_func(struct fsck_options *o, > struct object *obj, int type, const char *message) > { > - objreport(obj, (type == FSCK_WARN) ? "warning" : "error", message); > - return (type == FSCK_WARN) ? 0 : 1; > + if (type == FSCK_WARN) { > + fprintf_ln(stderr, "warning in %s %s: %s", > + printable_type(obj), describe_object(obj), message); > + return 0; > + } > + > + fprintf_ln(stderr, "error in %s %s: %s", > + printable_type(obj), describe_object(obj), message); > + return 1; Make it look more symmetrical like the original, perhaps by if (type == FSCK_WARN) { ... return 0; } else { /* FSCK_ERROR */ ... return 1; } Actually, wouldn't it be clearer to see what is going on, if we did it like this instead? const char *fmt = (type == FSCK_WARN) ? N_("warning in %s %s: %s") : N_("error in %s %s: %s"); fprintf_ln(stderr, _(fmt), printable_type(obj), describe_object(obj), message); return (type == FSCK_WARN) ? 0 : 1; It would show that in either case we show these three things in the message. I dunno.