Bug 195005 - kvprintf(9) and friends usage examples: trailing '\n' in bitfield argument is wrong (will be treated as bit 10)
Summary: kvprintf(9) and friends usage examples: trailing '\n' in bitfield argument is...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-14 14:01 UTC by Alexey Dokuchaev
Modified: 2015-03-07 13:09 UTC (History)
0 users

See Also:


Attachments
%b format usage fix (1.89 KB, patch)
2014-11-14 14:01 UTC, Alexey Dokuchaev
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Dokuchaev freebsd_committer 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 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.