svn commit: r364321 - head/sbin/ipfw

Ed Maste emaste at freebsd.org
Mon Aug 31 18:58:12 UTC 2020


On Mon, 31 Aug 2020 at 10:09, Rodney W. Grimes
<freebsd at gndrsh.dnsmgr.net> wrote:
>
> > Hrm, it seems this reply ended up in my spam folder; sorry for not
> > replying until now.
>
> lol Oh, bad filter :-)
>
> > > >                       *strchr(timestr, '\n') = '\0';
> > > >                       bprintf(bp, "%s ", timestr);
> > >                                        ^ Isnt this the +1 space?
> > >
> > > >               } else {
> > > > -                     bprintf(bp, "%*s", twidth, " ");
> > > > +                     bprintf(bp, "%*s", twidth + 1, " ");
> > >                                         ^missing from this string?
> >
> > Inserting an extra space in the format string would also work, sure. I
> > considered doing it that way but in the end decided it's not
> > materially more clear one way or another, so used the patch as
> > submitted.
>
> For me the + 1 leads to a "why is this here", where as the space
> in the format string clearly matches the other condition of the else.
> Also + 1 causes a run time computation, the extra space does not.

No, but the extra space adds a format string character which will be
more costly than the +1. I would have used "%*s " if twidth was
already used in the other case, to keep them consistent.

Anyhow, I think this isn't worth bikeshedding; I have no objection if
anyone feels "%*s " is more clear and wants to commit that change.


More information about the svn-src-all mailing list