Skip to content

Commit

Permalink
printf: Raise error on '%0c' and '%0s' formats
Browse files Browse the repository at this point in the history
  • Loading branch information
RenjiSann committed Feb 29, 2024
1 parent 58ee0ce commit 7094ff1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/uucore/src/lib/features/format/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ impl Spec {
Ok(match type_spec {
// GNU accepts minus, plus and space even though they are not used
b'c' => {
if flags.hash || precision.is_some() {
if flags.zero || flags.hash || precision.is_some() {
return Err(&start[..index]);
}
Self::Char {
Expand All @@ -180,7 +180,7 @@ impl Spec {
}
}
b's' => {
if flags.hash {
if flags.zero || flags.hash {
return Err(&start[..index]);
}
Self::String {
Expand Down

0 comments on commit 7094ff1

Please sign in to comment.