Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Dec 2012 16:32:07 GMT
From:      Daniel Shahaf <danielsh@elego.de>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/174521: printf(1) doesn't treat extra conversion specifiers as zero (posix)
Message-ID:  <201212171632.qBHGW7ij041062@red.freebsd.org>
Resent-Message-ID: <201212171640.qBHGe0NF040315@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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@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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212171632.qBHGW7ij041062>