better error messages for parsing rom title
This commit is contained in:
parent
538d8d75cc
commit
adaf203e73
1 changed files with 4 additions and 2 deletions
|
@ -9,7 +9,7 @@ use std::{
|
|||
io::{Read, Seek, SeekFrom, Write},
|
||||
marker::PhantomData,
|
||||
path::PathBuf,
|
||||
str::from_utf8_unchecked,
|
||||
str::from_utf8,
|
||||
};
|
||||
|
||||
use self::mbcs::{
|
||||
|
@ -194,7 +194,9 @@ where
|
|||
break;
|
||||
}
|
||||
}
|
||||
let title = unsafe { from_utf8_unchecked(&data[0x134..title_length]).to_string() };
|
||||
let title = from_utf8(&data[0x134..title_length])
|
||||
.expect("Error parsing title")
|
||||
.to_string();
|
||||
|
||||
let _gbc_flag = data[0x143];
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue