Skip to content

bug(date): when using like +%50c and +%50x it produces padding 0s overlapping #12897

@HackingRepo

Description

@HackingRepo

Hi, uutils mainteners

that is s formatting issue our test confirms

relunsec@relunsec:~/software/coreutils/target/debug$ ./date "+%50c"
00000000000000000000000000Mon Jun 15 04:32:51 2026
relunsec@relunsec:~/software/coreutils/target/debug$ gnudate "+%50c"
                   Mon 15 Jun 2026 04:32:54 AM EDT
relunsec@relunsec:~/software/coreutils/target/debug$ 

look gnu one correctly formatted it, correctly while the uu one just putted 0s overlapping to each others

and also what happend with +%50x and +%50X too

relunsec@relunsec:~/software/coreutils/target/debug$ ./date "+%50x"
00000000000000000000000000000000000000000006/15/26
relunsec@relunsec:~/software/coreutils/target/debug$ gnudate "+%50x"
                                        06/15/2026
relunsec@relunsec:~/software/coreutils/target/debug$ ./date "+%50X"
00000000000000000000000000000000000000000004:43:55
relunsec@relunsec:~/software/coreutils/target/debug$ gnudate "+%50X"
                                       04:44:00 AM
relunsec@relunsec:~/software/coreutils/target/debug$ 

and with +%50r too

relunsec@relunsec:~/software/coreutils/target/debug$ ./date "+%50r"
00000000000000000000000000000000000000004:46:54 AM
relunsec@relunsec:~/software/coreutils/target/debug$ 

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions