XDR incorrect encoding of uint16; tests and benchmarks

This commit is contained in:
Jakob Borg
2014-06-30 12:56:09 +02:00
parent 4f6ee7c8eb
commit 7633b9672f
7 changed files with 268 additions and 5 deletions

View File

@@ -79,10 +79,10 @@ func (w *Writer) WriteUint16(v uint16) (int, error) {
dl.Debugf("wr uint16=%d", v)
}
w.b[0] = byte(v >> 8)
w.b[1] = byte(v)
w.b[2] = 0
w.b[3] = 0
w.b[0] = 0
w.b[1] = 0
w.b[2] = byte(v >> 8)
w.b[3] = byte(v)
var l int
l, w.err = w.w.Write(w.b[:4])