Fix bug: ReadByte return EOF when read success
This commit is contained in:
@ -52,6 +52,9 @@ type reader struct {
|
||||
|
||||
func (r reader) ReadByte() (byte, error) {
|
||||
var b [1]byte
|
||||
_, err := r.Read(b[:])
|
||||
return b[0], err
|
||||
n, err := r.Read(b[:])
|
||||
if n == 1 {
|
||||
return b[0], nil
|
||||
}
|
||||
return 0, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user