mirror of
https://codeberg.org/demostf/parser.git
synced 2026-06-03 18:24:05 +02:00
fix handling of mallformed utf8
This commit is contained in:
parent
e5e54de65d
commit
8f754d3f44
4 changed files with 8 additions and 5 deletions
|
|
@ -32,7 +32,7 @@ impl<'a> Demo<'a> {
|
|||
|
||||
pub(crate) fn handle_utf8_error(error: BitError) -> ReadResult<String> {
|
||||
match error {
|
||||
BitError::Utf8Error(_) => Ok("-- Malformed utf8 --".into()),
|
||||
BitError::Utf8Error(_, _) => Ok("-- Malformed utf8 --".into()),
|
||||
_ => Err(error),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ pub enum GameEventError {
|
|||
impl From<BitError> for ParseError {
|
||||
fn from(err: BitError) -> ParseError {
|
||||
match err {
|
||||
BitError::Utf8Error(utf8_error) => ParseError::MalformedUTF8(utf8_error),
|
||||
BitError::Utf8Error(utf8_error, _) => ParseError::MalformedUTF8(utf8_error),
|
||||
_ => ParseError::ReadError(err),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue