1
0
Fork 0
mirror of https://codeberg.org/icewind/vbsp.git synced 2026-06-03 10:44:07 +02:00

entity utf8 again

This commit is contained in:
Robin Appelman 2023-12-27 20:40:44 +01:00
commit 89f2f3ba7a

View file

@ -28,7 +28,7 @@ impl<'a> LumpReader<Cursor<Cow<'a, [u8]>>> {
impl<R: BinReaderExt + Read> LumpReader<R> {
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)?;
let entities = String::from_utf8(data).map_err(|e| StringError::from(e.utf8_error()))?;
Ok(Entities { entities })