Skip to content

printf: incorrect exit code when passing invalid value to %x #5536

@sylvestre

Description

@sylvestre

With GNU:

/usr/bin/printf %x %194 > /dev/null
echo $?

returns:

/usr/bin/printf: '%194': expected a numeric value
1

With our Rust implementation:

./target/debug/coreutils printf %x %194 > /dev/null
echo $? 

returns:

printf: '%194': value not completely converted
0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions