Re: (fwd) bin/47196: ipfw won't format correctly output from 'ipfw show' command
Giorgos Keramidas <[email protected]> Thu, 23 Jan 2003 21:53:35 +0200
| Newsgroups | gmane.os.freebsd.devel.audit |
|---|---|
| Message-ID | <[email protected]> |
On 2003-01-23 19:10, Maxim Konovalov <[email protected]> wrote: > On 05:40+0200, Jan 23, 2003, Giorgos Keramidas wrote: > > I've sent the following 2 days ago to ipfw@ but received no reply. > > Does anyone feel like testing/reviewing or committing this? This > > change should be all we need to fix & close PR bin/47196 :-) > > Formatting was broken in rev. 1.103 ipfw.c in -CURRENT and ipfw2 > in -CURRENT and -STABLE inherited the bug later. > > I think we should rever this part of rev. 1.103 of ipfw.c in ipfw2.c: Not quite. See inline comments. > Index: ipfw/ipfw2.c > =================================================================== > RCS file: /home/ncvs/src/sbin/ipfw/ipfw2.c,v > retrieving revision 1.21 > diff -u -r1.21 ipfw2.c > --- ipfw/ipfw2.c 12 Jan 2003 03:31:10 -0000 1.21 > +++ ipfw/ipfw2.c 23 Jan 2003 16:07:09 -0000 > @@ -823,7 +823,7 @@ > printf("%05u ", rule->rulenum); > > if (do_acct) > - printf("%10qu %10qu ", rule->pcnt, rule->bcnt); > + printf("%*qu %*qu ", rule->pcnt, rule->bcnt); The %*qu specifier needs two arguments. The first is the length, and the second should be rule->pcnt. The same for the second one. You'd have to use something like: printf("%*qu %*qu ", rule_width, rule->pcnt, byte_width, rule->bcnt); > - printf("%05d %10qu %10qu (%ds)", > + printf("%05d %*qu %*qu (%ds)", > d->rulenum, d->pcnt, d->bcnt, d->expire); Ditto. To Unsubscribe: send mail to [email protected] with "unsubscribe freebsd-audit" in the body of the message