bin/174521: printf(1) doesn't treat extra conversion specifiers as zero (posix)

Daniel Shahaf danielsh at elego.de
Mon Dec 17 16:40:01 UTC 2012


>Number:         174521
>Category:       bin
>Synopsis:       printf(1) doesn't treat extra conversion specifiers as zero (posix)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec 17 16:40:00 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Daniel Shahaf
>Release:        9.0-RELEASE
>Organization:
elego Software Solutions GmbH
>Environment:
FreeBSD loki.apache.org 9.0-RELEASE FreeBSD 9.0-RELEASE #0 r231596: Sun Feb 19 02:42:36 UTC 2012     root at loki.apache.org:/usr/obj/usr/src/sys/GENERIC  amd64

>Description:
/usr/bin/printf %u%u 15

Actual output: "1515"

Expected output: "150"



POSIX specifies that extra format specifiers shall be treated as zero:

http://mid.gmane.org/201212171135.14216.Arfrever.FTA@gmail.com

dash,bash,zsh, as well as Solaris and Linux, print "150".  But printf(1) on FreeBSD prints "1515".

Reproduced by eadler@ on -CURRENT.
>How-To-Repeat:
/usr/bin/printf %u%u 15
(should output 150)
>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list