Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 02 Dec 2014 20:44:45 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 195584] New: patch: fix %c in awk's printf when printing a number near 0
Message-ID:  <bug-195584-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195584

            Bug ID: 195584
           Summary: patch: fix %c in awk's printf when printing a number
                    near 0
           Product: Base System
           Version: 11.0-CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: bin
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: naddy@FreeBSD.org

Created attachment 150103
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=150103&action=edit
fix %c in awk's printf when printing a number near 0

The awk bug described here
http://marc.info/?l=openbsd-misc&m=141735117703872&w=2
and fixed here
http://marc.info/?l=openbsd-tech&m=141739334413710&w=2
also applies to FreeBSD.

How to reproduce:

$ awk 'END { printf "%c", 0 }' </dev/null | hd
00000000  00                                                |.|
00000001
$ awk 'END { printf "%c", 0.1 }' </dev/null | hd
$ 

awk fails to print a nul byte with %c for floating point values that are
coerced to 0.

Patch attached.  Credit to Jeremy Devenport.  This affects all supported
branches.

-- 
You are receiving this mail because:
You are the assignee for the bug.



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