add io.readChars overload (simpler, less error prone) (#16044)
* add simpler to use readChars overload * use new readChars overload * Update lib/wrappers/openssl.nim Co-authored-by: Andreas Rumpf <rumpf_a@web.de> Co-authored-by: flywind <xzsflywind@gmail.com>
This commit is contained in:
parent
a1f4113705
commit
ce7caec4b3
5 changed files with 50 additions and 6 deletions
|
|
@ -231,7 +231,7 @@ proc secureHashFile*(filename: string): SecureHash =
|
|||
var state = newSha1State()
|
||||
var buffer = newString(BufferLength)
|
||||
while true:
|
||||
let length = readChars(f, buffer, 0, BufferLength)
|
||||
let length = readChars(f, buffer)
|
||||
if length == 0:
|
||||
break
|
||||
buffer.setLen(length)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue