mirror of
https://codeberg.org/icewind/vbsp.git
synced 2026-06-03 18:54:05 +02:00
entity utf8 again
This commit is contained in:
parent
d11d90c8e6
commit
89f2f3ba7a
1 changed files with 1 additions and 1 deletions
|
|
@ -28,7 +28,7 @@ impl<'a> LumpReader<Cursor<Cow<'a, [u8]>>> {
|
||||||
|
|
||||||
impl<R: BinReaderExt + Read> LumpReader<R> {
|
impl<R: BinReaderExt + Read> LumpReader<R> {
|
||||||
pub fn read_entities(&mut self) -> BspResult<Entities> {
|
pub fn read_entities(&mut self) -> BspResult<Entities> {
|
||||||
let mut data: Vec<u8> = Vec::with_capacity(self.length);
|
let mut data: Vec<u8> = vec![0; self.length];
|
||||||
self.inner.read_exact(&mut data)?;
|
self.inner.read_exact(&mut data)?;
|
||||||
let entities = String::from_utf8(data).map_err(|e| StringError::from(e.utf8_error()))?;
|
let entities = String::from_utf8(data).map_err(|e| StringError::from(e.utf8_error()))?;
|
||||||
Ok(Entities { entities })
|
Ok(Entities { entities })
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue