Remove unnecessary null byte check

This commit is contained in:
lordwelch 2020-11-26 02:18:03 -08:00
parent 23cb8d1e85
commit 73c3b3c045

View File

@ -133,10 +133,6 @@ func ReadCString(r io.Reader, length int) (string, error) {
return string(buf[:clen(buf)]), err return string(buf[:clen(buf)]), err
} }
if buf[len(buf)-1] != 0 {
return string(buf[:clen(buf)]), errors.New("string is not null-terminated")
}
return string(buf[:clen(buf)]), nil return string(buf[:clen(buf)]), nil
} }