Skip to content

Commit

Permalink
Handle invalid utf8 chars when parsing server info.
Browse files Browse the repository at this point in the history
  • Loading branch information
vikpe committed Jun 4, 2024
1 parent 91e1ea9 commit 2ed11ad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ categories = ["parsing"]
keywords = ["demos", "mvd", "parser", "quake", "quakeworld"]
repository = "https://github.com/vikpe/mvdparser"
authors = ["Viktor Persson <viktor.persson@arcsin.se>"]
version = "0.9.1"
version = "0.9.2"
edition = "2021"
license = "MIT"
include = [
Expand Down
2 changes: 1 addition & 1 deletion src/serverinfo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub fn serverinfo_string(data: &[u8]) -> Option<String> {
br#"fullserverinfo ""#,
&[b'"'],
)?;
String::from_utf8(data[from..to].to_vec()).ok()
Some(quake_text::bytestr::to_utf8(&data[from..to]))
}

#[cfg(test)]
Expand Down

0 comments on commit 2ed11ad

Please sign in to comment.