Bug 195005

Summary: kvprintf(9) and friends usage examples: trailing '\n' in bitfield argument is wrong (will be treated as bit 10)
Product: Base System Reporter: Alexey Dokuchaev <danfe>
Component: miscAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: ---    
Version: CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
%b format usage fix none

Description Alexey Dokuchaev freebsd_committer freebsd_triage 2014-11-14 14:01:49 UTC
Created attachment 149399 [details]
%b format usage fix

Consider attached patch, which fixes usage example in kvprintf(9) and friends: trailing '\n' in bitfield argument looks wrong, as it will be treated as bit 10, causing any code printing >=10 bits with bit 10 on as having a trailing comma.

Newline (intended one) should be part of the format string (already present in examples).
Comment 1 commit-hook freebsd_committer freebsd_triage 2015-01-23 07:32:00 UTC
A commit references this bug:

Author: danfe
Date: Fri Jan 23 07:30:59 UTC 2015
New revision: 277560
URL: https://svnweb.freebsd.org/changeset/base/277560

Log:
  Fix usage example in kvprintf(9) and its copy in libstand(3): trailing '\n'
  in bitfield argument is wrong, as it will be treated as bit 10, causing any
  code printing >=10 bits with bit 10 on as having a trailing comma.

  Newline (intended one) should be part of the format string (already present
  in the examples).

  Also fix grammar and kill EOL whitespace in comment while here.

  PR:		195005
  Approved by:	bdrewery

Changes:
  head/lib/libstand/libstand.3
  head/lib/libstand/printf.c
  head/share/man/man9/printf.9
  head/sys/kern/subr_prf.c
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2015-03-07 13:09:52 UTC
Committed as 277560.