summaryrefslogtreecommitdiff
path: root/libgo/go/encoding/gob/decode.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/encoding/gob/decode.go')
-rw-r--r--libgo/go/encoding/gob/decode.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/libgo/go/encoding/gob/decode.go b/libgo/go/encoding/gob/decode.go
index 900c69ddb47..a80d9f9195f 100644
--- a/libgo/go/encoding/gob/decode.go
+++ b/libgo/go/encoding/gob/decode.go
@@ -62,15 +62,15 @@ func overflow(name string) error {
// Used only by the Decoder to read the message length.
func decodeUintReader(r io.Reader, buf []byte) (x uint64, width int, err error) {
width = 1
- _, err = r.Read(buf[0:width])
- if err != nil {
+ n, err := io.ReadFull(r, buf[0:width])
+ if n == 0 {
return
}
b := buf[0]
if b <= 0x7f {
return uint64(b), width, nil
}
- n := -int(int8(b))
+ n = -int(int8(b))
if n > uint64Size {
err = errBadUint
return