mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 22:37:49 +00:00
Handle non-printable characters in vga buffer module (#425)
This commit is contained in:
committed by
GitHub
parent
21fb890328
commit
6d0f103c16
@@ -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),
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user