diff --git a/src/main.rs b/src/main.rs index 8907f3f..0ec0960 100644 --- a/src/main.rs +++ b/src/main.rs @@ -98,7 +98,15 @@ pub fn main() -> Result<(), std::io::Error> { break; }, - _ => { pb.add_char(*q); } + + // Only process sane characters + 'a'..='z' | 'A'..='Z' | '0'..='9' + |'!'|'@'|'#'|'$'|'%'|'^'|'&'|'*'|'('|')' + |'?'|'~'|','|'.'|'['|']' + |'<'|'>'|'/'|'_'|'-'|':'|'|'|'='|'+'|';' + => { pb.add_char(*q); }, + + _ => {} }; } else { match c.unwrap() {