Remove unnecessary null byte check
This commit is contained in:
parent
23cb8d1e85
commit
73c3b3c045
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user