Handle non-printable characters in vga buffer module (#425)

This commit is contained in:
Philipp Oppermann
2018-04-07 19:45:28 +02:00
committed by GitHub
parent 21fb890328
commit 6d0f103c16
3 changed files with 25 additions and 10 deletions

View File

@@ -107,7 +107,13 @@ impl Writer {
/// mode.
fn write_string(&mut self, s: &str) {
for byte in s.bytes() {
self.write_byte(byte)
match byte {
// printable ASCII byte or newline
0x20...0x7e | b'\n' => self.write_byte(byte),
// not part of printable ASCII range
_ => self.write_byte(0xfe),
}
}
}