Skip to content

Commit

Permalink
Remove any inner ascii-control character or new line
Browse files Browse the repository at this point in the history
  • Loading branch information
neithanmo committed Jan 6, 2025
1 parent 5eae1ea commit b28c338
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/rust/src/parser/consent_message/buffer_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ impl<'a> BufferWriter<'a> {
}

let mut char = c;
if !c.is_ascii() || c == '\n' {
if !c.is_ascii() || c.is_ascii_control() || c == '\n' {
char = ' ';
}

Expand All @@ -41,10 +41,10 @@ impl<'a> BufferWriter<'a> {
}

// // Pad with spaces if needed
while num_chars < MAX_CHARS_PER_LINE {
self.write_byte(b' ')?;
num_chars += 1;
}
// while num_chars < MAX_CHARS_PER_LINE {
// self.write_byte(b' ')?;
// num_chars += 1;
// }

// Add newline if not the last line
if add_newline {
Expand Down

0 comments on commit b28c338

Please sign in to comment.