tape: Fix Encoder.WriteUintN not using the value AT ALL!

This commit is contained in:
Sasha Koshka 2025-06-24 14:38:01 -04:00
parent 477e56d359
commit 1bc0788ff2

View File

@ -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)
buffer := [1]byte { }
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[:])
n += nn; if err != nil { return n, err }
}