Fix NotNullTerminated error for full-length strings

When a fixed-length string field uses its entire buffer without a null
terminator, treat the full buffer as valid content instead of erroring.
This handles edge cases in some MDL files where string fields are
completely filled.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
noahsabaj 2026-01-04 22:24:26 -05:00
commit 115e233517

View file

@ -270,7 +270,7 @@ impl<const LEN: usize> TryFrom<[u8; LEN]> for FixedString<LEN> {
let zero_pos = name_buf
.iter()
.position(|c| *c == 0)
.ok_or(StringError::NotNullTerminated)?;
.unwrap_or(name_buf.len());
let name = &name_buf[..zero_pos];
Ok(FixedString(
ArrayString::from(str::from_utf8(name).map_err(StringError::NonUTF8)?).unwrap(),