fix(cartridge): trim whitespace from cartridge title
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Rekai Nyangadzayi Musuka 2021-08-19 21:53:36 -05:00
parent b829f05a34
commit 3c2456611e
1 changed files with 1 additions and 1 deletions

View File

@ -57,7 +57,7 @@ impl Cartridge {
fn find_title(memory: &[u8]) -> Option<String> {
let slice = &memory[ROM_TITLE_RANGE];
let with_nulls = std::str::from_utf8(slice).ok();
let trimmed = with_nulls.map(|s| s.trim_matches('\0'));
let trimmed = with_nulls.map(|s| s.trim_matches('\0').trim());
match trimmed {
Some("") | None => None,