Fix x86 int conversion.

This commit is contained in:
cheatfate 2021-02-18 14:39:05 +02:00 committed by zah
parent eb81018d02
commit 1d49ae7a47
1 changed files with 2 additions and 1 deletions

View File

@ -111,7 +111,8 @@ proc chunkedReadLoop(stream: AsyncStreamReader) {.async.} =
var chunksize = cres.get()
if chunksize > 0'u64:
while chunksize > 0'u64:
let toRead = min(int(chunksize), rstream.buffer.bufferLen())
let toRead = int(min(chunksize,
uint64(rstream.buffer.bufferLen())))
await rstream.rsource.readExactly(rstream.buffer.getBuffer(),
toRead)
rstream.buffer.update(toRead)