tape: Fix Encoder.WriteUintN not using the value AT ALL!
This commit is contained in:
parent
477e56d359
commit
1bc0788ff2
@ -92,7 +92,7 @@ func (this *Encoder) WriteUintN(value uint64, bytes int) (n int, err error) {
|
|||||||
// TODO: don't make multiple write calls (without allocating)
|
// TODO: don't make multiple write calls (without allocating)
|
||||||
buffer := [1]byte { }
|
buffer := [1]byte { }
|
||||||
for bytesLeft := bytes; bytesLeft > 0; bytesLeft -- {
|
for bytesLeft := bytes; bytesLeft > 0; bytesLeft -- {
|
||||||
buffer[0] = byte(buffer[0]) >> ((bytesLeft - 1) * 8)
|
buffer[0] = byte(value) >> ((bytesLeft - 1) * 8)
|
||||||
nn, err := this.Write(buffer[:])
|
nn, err := this.Write(buffer[:])
|
||||||
n += nn; if err != nil { return n, err }
|
n += nn; if err != nil { return n, err }
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user