Skip to content

printf: Integers: If value and precision are zero, nothing should be printed #7509

@drinkcat

Description

@drinkcat

Looking at C/C++ reference https://en.cppreference.com/w/c/io/fprintf:

If both the converted value and the precision are ​0​ the conversion results in no characters.

$ env printf "%.0d\n" 0
<blank line>
$ ./coreutils-main printf "%.0d\n" 0
0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions