extend printf(9) %b format to allow 0 bits set

Sean Bruno seanwbruno at gmail.com
Thu Apr 4 21:20:55 UTC 2013


A small patch from my wanderings today for your review.  This patch to
kvprintf() allows me to set a %b format string of:

 "\20\0unset\1ONESET\2TWOSET"

In the case that the variable being compared has the value of 0, it will
display "0x0<unset>"

http://people.freebsd.org/~sbruno/subr_prf.txt

Sean
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20130404/afaeb87d/attachment.sig>


More information about the freebsd-hackers mailing list